SEO - v1.0.0
Installation
This guide covers the complete installation process for ArtisanPack UI SEO.
Install via Composer
composer require artisanpack-ui/seo
Run Migrations
The package includes migrations for the SEO database tables:
php artisan migrate
This creates the following tables:
seo_meta- Stores SEO metadata for your modelsredirects- Stores URL redirect rulessitemap_entries- Tracks sitemap entriesseo_analysis_cache- Caches SEO analysis results
Publish Assets
Configuration File
Publish the configuration file to customize default settings:
php artisan vendor:publish --tag=seo-config
This creates config/seo.php with all available options.
Views (Optional)
If you need to customize the Blade components or Livewire component views:
php artisan vendor:publish --tag=seo-views
Migrations (Optional)
If you need to modify the database schema:
php artisan vendor:publish --tag=seo-migrations
Service Provider
The package auto-discovers its service provider. If you have disabled auto-discovery, add the service provider to your config/app.php:
'providers' => [
// ...
ArtisanPackUI\Seo\SeoServiceProvider::class,
],
Facade (Optional)
The package provides a Seo facade for convenient access:
use ArtisanPackUI\Seo\Facades\Seo;
$meta = Seo::getMetaForModel($post);
Middleware Setup
To enable automatic URL redirect handling, add the redirect middleware to your bootstrap/app.php:
->withMiddleware(function (Middleware $middleware) {
$middleware->web(append: [
\ArtisanPackUI\Seo\Http\Middleware\HandleRedirects::class,
]);
})
Or add it to specific route groups as needed.
Verify Installation
To verify the installation is working:
// In tinker or a controller
use ArtisanPackUI\Seo\Facades\Seo;
// Should return the SeoService instance
$seo = seo();
// Check configuration
$config = seoConfig('site.name');
Next Steps
- Requirements - System requirements and dependencies
- Configuration - Detailed configuration options
- Quick Start Guide - Get started quickly