Did it install properly?
Check your composer.json file if it is listed in there
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have installed the package
composer require spatie/nova-translatable
then following what is written in the documentation I entered:
\Spatie\NovaTranslatable\Translatable::defaultLocales(['en', 'fr']);
in AppServiceProvider as follows:
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
\Spatie\NovaTranslatable\Translatable::defaultLocales(['en', 'fr','it']);
}
}
give me following error :
Error Class 'Spatie\NovaTranslatable\Translatable' not found app/Providers/AppServiceProvider.php:26
Try importing the file, and running composer dump-autoload
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Spatie\NovaTranslatable\Translatable;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Translatable::defaultLocales(['en', 'fr','it']);
}
}
Please or to participate in this conversation.