FilamentF
Filament7mo ago
kossa

Spatie translatable: Switcher not showing in simple resource

Hello,

I'm using https://filamentphp.com/plugins/filament-spatie-translatable, it works fine on all pages, except for simple resource, in the doc they mentioned "If you're using a simple resource, you can make the ManageRecords page translatable instead:" here is my code

<?php

namespace App\Filament\Resources\MainRouteResource\Pages;

use App\Filament\Resources\MainRouteResource;
use Filament\Actions;
use Filament\Actions\LocaleSwitcher;
use Filament\Resources\Pages\ListRecords;
use Filament\Resources\Pages\ManageRecords;

class ListMainRoutes extends ListRecords
{
    use ManageRecords\Concerns\Translatable;

    protected static string $resource = MainRouteResource::class;

    protected function getHeaderActions(): array
    {
        return [
            LocaleSwitcher::make(),
            Actions\CreateAction::make(),
        ];
    }
}
image.png
Was this page helpful?