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

Add database support #186

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open

Add database support #186

wants to merge 34 commits into from

Conversation

aerni
Copy link
Owner

@aerni aerni commented Feb 7, 2025

This PR adds support for storing Advanced SEO defaults in the database and closes #76.

Install the Statamic Eloquent Driver:

composer require statamic/eloquent-driver

Publish and run migrations:

php artisan vendor:publish --tag=statamic-eloquent-advanced-seo-migrations
php artisan migrate

Add this config to config/statamic/eloquent-driver.php

'advanced_seo' => [
    'driver' => 'eloquent',
    'model'  => Aerni\AdvancedSeo\Eloquent\SeoDefaultModel::class,
],

Import existing file-based Advanced SEO defaults into the database:

php please eloquent:import-advanced-seo

You may also export eloquent-based Advanced SEO defaults to flat files:

php please eloquent:export-advanced-seo

This installation process will be a lot easier once statamic/cms#11426 is merged. At that point, you can simply run php please install:eloquent-driver and follow the steps.

@lukevmk
Copy link

lukevmk commented Feb 21, 2025

Would love to use this, when do you plan on merging this?

@aerni
Copy link
Owner Author

aerni commented Feb 21, 2025

I'm still pondering on the best approach to configuring the eloquent driver, and wanted to wait on a decision in statamic/cms#11426 before merging. If this PR gets rejected, I might move the config into advanced-seo.php instead of eloquent-driver.php.

aerni added 6 commits March 3, 2025 14:49
commit 3ab44a0
Author: Michael Aerni <[email protected]>
Date:   Mon Mar 3 14:28:33 2025 -0500

    Add support for Laravel 12 (#193)

commit 6af5b75
Author: Brian Faust <[email protected]>
Date:   Sat Mar 1 00:14:11 2025 +0200

    Only register sitemap routes if sitemap feature is enabled (#192)

commit ff3855d
Author: Michael Aerni <[email protected]>
Date:   Thu Feb 20 15:22:26 2025 -0500

    Use autoloading (#190)

commit 2eb5fab
Author: Michael Aerni <[email protected]>
Date:   Tue Feb 18 11:32:41 2025 -0500

    Fix duplicate IDs Stache error (#188)
commit 3ab44a0
Author: Michael Aerni <[email protected]>
Date:   Mon Mar 3 14:28:33 2025 -0500

    Add support for Laravel 12 (#193)

commit 6af5b75
Author: Brian Faust <[email protected]>
Date:   Sat Mar 1 00:14:11 2025 +0200

    Only register sitemap routes if sitemap feature is enabled (#192)

commit ff3855d
Author: Michael Aerni <[email protected]>
Date:   Thu Feb 20 15:22:26 2025 -0500

    Use autoloading (#190)

commit 2eb5fab
Author: Michael Aerni <[email protected]>
Date:   Tue Feb 18 11:32:41 2025 -0500

    Fix duplicate IDs Stache error (#188)
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