Skip to content
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

Allow for swappable SiteDefaults implementation #302

Merged
merged 2 commits into from
Nov 10, 2023

Conversation

jesseleite
Copy link
Member

@jesseleite jesseleite commented Nov 10, 2023

With this PR, you can now override where site defaults are stored by providing a custom SiteDefaults implementation:

$this->app->bind(\Statamic\SeoPro\SiteDefaults::class, \App\MySiteDefaults::class);

This is for @ryanmitchell to store site defaults in a database by overloading the save and getDefaults methods ❤️

Closes #298 (This PR is just a slightly simpler alternative)

@jesseleite
Copy link
Member Author

Thoughts on this @ryanmitchell? Do you see any downsides to this approach?

Also curious if you have need to override the blueprint() method? If so, I could make this method non-static / an overridable instance method 👍

@ryanmitchell
Copy link
Contributor

Definitely simpler, i should have read the code more fully and done that :)

We don't need to override the blueprint method but it may be a good idea to change it for others.

@jesseleite jesseleite changed the title Swappable SiteDefaults implementation Allow for swappable SiteDefaults implementation Nov 10, 2023
@jesseleite
Copy link
Member Author

jesseleite commented Nov 10, 2023

Re: Blueprint method... Agreed and done 🤘

@jesseleite jesseleite merged commit fadca17 into master Nov 10, 2023
24 checks passed
@jesseleite jesseleite deleted the swappable-site-defaults branch November 10, 2023 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants