PHP code example of nomanur / filament-seo-pro

1. Go to this page and download the library: Download nomanur/filament-seo-pro library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nomanur / filament-seo-pro example snippets


use Nomanur\FilamentSeoPro\SeoPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugins([
            SeoPlugin::make(),
        ]);
}

use Illuminate\Database\Eloquent\Model;
use Nomanur\FilamentSeoPro\Traits\HasSeo;

class Post extends Model
{
    use HasSeo;
    // ...
}

use Filament\Forms\Components\Tabs;
use Nomanur\FilamentSeoPro\Forms\SeoTab;

public static function form(Form $form): Form
{
    return $form
        ->schema([
            Tabs::make('Post')
                ->tabs([
                    Tabs\Tab::make('Content')
                        ->schema([
                            // Your content fields
                        ]),
                    SeoTab::make(), // Automatically injects the full SEO interface
                ])
        ]);
}

use Nomanur\FilamentSeoPro\Forms\SeoSection;

public static function form(Form $form): Form
{
    return $form
        ->schema([
            // Your content fields...
            SeoSection::make(),
        ]);
}

SeoPlugin::make()
    ->defaultContentField('body') // Field used for content analysis (default: 'content')
    ->defaultTitleField('name')   // Field used as fallback title (default: 'title')
    ->defaultSlugField('permalink') // Field used for URL preview (default: 'slug')
    ->enableDashboardWidget(true) // Show SEO Overview widget on dashboard
    ->enableManagementPage(true)  // Show SEO Management page in navigation
    ->models([                    // Models to 

SeoTab::make()
    ->contentField('post_body')
    ->titleField('post_title')
    ->slugField('post_slug')
bash
php artisan filament:assets
bash
php artisan vendor:publish --tag="filament-seo-pro-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="filament-seo-pro-config"