-
-
Notifications
You must be signed in to change notification settings - Fork 539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.x] Move sites out of config #9632
Conversation
… to go, just append to end of file.
# Conflicts: # tests/FrontendTest.php
I'm wondering if this should be in the CP nav under |
That's a good thought. |
With more complex site configurations, it is now much more difficult to achieve a reliable result with all these curly brackets as placeholders for URLs etc. - especially if you have also used PHP enums or collections/arrays in the "attributes". Code analysis and testing also now seem more difficult to achieve. Is there still a way e.g. to override this Thanks! |
We're not planning on adding back a PHP method for configuring sites. However, in your case, you could potentially override the sites in a service provider, like this: // app/Providers/AppServiceProvider.php
use Statamic\Facades\Site;
use Statamic\Statamic;
Statamic::booted(function () {
Site::setSites([
'default' => [
'name' => 'Default',
'locale' => 'en_US',
'url' => YourEnum::Url,
],
]);
}); |
Thanks! |
What is changing...
The idea here is to move
sites
configuration out of the php config directory, and intocontent/sites.yaml
, so that we can provide a nice GUI for managing your site/sites (since theconfig
directory is meant to be edited by devs only)...If you need multi-site, you enable it in
config/statamic/system.php
...We've also streamlined the
php please multisite
command to do this for you...This allows you to manage multiple sites in the cp...
Of course, you can still manage your sites by hand as before, but now that'll be in
content/sites.yaml
...TODO...
statamic.sites.sites
configstatamic.system.multisite
configSites
classsetConfig()
method, with deprecated backwards compatibility fallback for addonssetSites()
andsetSiteValue()
methodssave()
methodsites
configdirection
from configconfig('statamic.sites.sites')
to use new yaml sites configphp please multisite
commandmultisite
config into theirconfig/statamic/system.php
config/statamic/sites.php
tocontent/sites.yaml
config/statamic/sites.php
config, since it is no longer neededCloses statamic/ideas#1080