Spatie Translatable Plugin - Language tabs not showing in form

Hello everyone I'm having a persistent issue with the spatie/laravel-translatable plugin where the language tabs are not appearing in my resource form. I've followed the documentation and tried every debugging step I can think of, but with no success. I would really appreciate some help. Here's what I've done and verified: * Installed spatie/laravel-translatable. * Installed filament/spatie-laravel-translatable-plugin. * The Instructor model is correctly configured with the HasTranslations trait and the $translatable property for the name field. * A migration was run to change the name column type to TEXT in the database. * The plugin is correctly registered in the AdminPanelProvider. * I have cleared all caches multiple times using php artisan optimize:clear. * The test is being done on a very simple resource (InstructorResource) to isolate the problem. Despite all this, the language tabs do not appear on the name field. app/Providers/Filament/AdminPanelProvider.php
<?php
namespace App\Providers\Filament;

use Filament\Panel;
use Filament\PanelProvider;
use Filament\SpatieLaravelTranslatablePlugin;

class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->default()
->id('admin')
->path('admin')
// ... other settings ...
->plugin(
SpatieLaravelTranslatablePlugin::make()
->defaultLocales(['ro', 'en', 'ru'])
);
}
}
<?php
namespace App\Providers\Filament;

use Filament\Panel;
use Filament\PanelProvider;
use Filament\SpatieLaravelTranslatablePlugin;

class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->default()
->id('admin')
->path('admin')
// ... other settings ...
->plugin(
SpatieLaravelTranslatablePlugin::make()
->defaultLocales(['ro', 'en', 'ru'])
);
}
}
app/Models/Instructor.php
<?php
namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Spatie\Translatable\HasTranslations;

class Instructor extends Model
{
use HasFactory, HasTranslations;

public array $translatable = ['name'];

// ...
}
<?php
namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Spatie\Translatable\HasTranslations;

class Instructor extends Model
{
use HasFactory, HasTranslations;

public array $translatable = ['name'];

// ...
}
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?