Skip to main content
1

Prepare your model

use Usamamuneerchaudhary\FilaRank\Concerns\HasSeo;

class Post extends Model
{
    use HasSeo;
}
By default the analyzer reads the model’s content and slug attributes and falls back to title for the page title. Override if your columns differ:
public function getSeoContent(): ?string
{
    return $this->body;
}

public function getSeoSlug(): ?string
{
    return $this->permalink;
}
2

Add the SEO section to your Filament form

use Usamamuneerchaudhary\FilaRank\Forms\SeoFields;

public static function form(Schema $schema): Schema
{
    return $schema->components([
        TextInput::make('title'),
        TextInput::make('slug'),
        RichEditor::make('content'),

        SeoFields::make(), // assumes `content` + `slug` fields on this form
    ]);
}
If your body field has a different name, or lives somewhere unusual in the schema tree:
SeoFields::make(contentField: 'body', slugField: 'permalink');

// or take full control of where the values come from:
SeoFields::make(
    getContentUsing: fn (Get $get) => $get('../body'),
    getSlugUsing: fn (Get $get) => $get('../permalink'),
);
SeoFields::make() binds to the seo relationship, so it must be used on a form with a record model that uses HasSeo.
3

Show the score in your table

use Usamamuneerchaudhary\FilaRank\Tables\SeoScoreColumn;

public static function table(Table $table): Table
{
    return $table->columns([
        TextColumn::make('title'),
        SeoScoreColumn::make(),
    ]);
}
Scores are recalculated and stored whenever the model is saved (disable with 'persist_score' => false).
4

Render the tags on your frontend

In your layout’s <head>:
<x-filarank::tags :model="$post" />
Or for static pages without a model:
<x-filarank::tags title="Contact us" description="Get in touch with our team." />
5

Analyze anything programmatically

use Usamamuneerchaudhary\FilaRank\SeoAnalyzer;

$report = SeoAnalyzer::analyze([
    'title' => 'Coffee Beans Guide',
    'description' => '…',
    'focus_keyword' => 'coffee beans',
    'slug' => 'coffee-beans',
    'content' => $html,
]);

$report->score();            // 0–100 or null
$report->seoScore();
$report->readabilityScore();
$report->rating();           // Status::Good | Ok | Bad
$report->results;            // list of CheckResult
Or against a model directly: SeoAnalyzer::analyzeModel($post).