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 28 commits into
base: main
Choose a base branch
from
Open

Add database support #186

wants to merge 28 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.

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