PHP code example of rankbeam / laravel-seo-filament

1. Go to this page and download the library: Download rankbeam/laravel-seo-filament 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/ */

    

rankbeam / laravel-seo-filament example snippets


use Rankbeam\Seo\Traits\HasSEO;

class Post extends Model
{
    use HasSEO;
}

use Rankbeam\Seo\Filament\Concerns\HasSEOFields;

class PostResource extends Resource
{
    use HasSEOFields;                       // 1

    public static function form(Schema $schema): Schema
    {
        return $schema->components([
            TextInput::make('title'),
            // ...
            static::seoSection(),           // 2
        ]);
    }
}

static::seoSection(showPreview: false);   // or SEOFields::make(showPreview: false)

static::seoSchemaSection(),     // or SEOSchemaFields::make()
bash
php artisan vendor:publish --tag=seo-config
php artisan migrate