F
Filamentβ€’11mo ago
Benjamin

Trying to debug : Company::setTranslation(): Argument #2 ($locale) must be of type string, null...

Hi ! Has anyone here come across this error before? I'm a bit lost 😦
class Company extends Model
{
use HasFactory, HasTranslations;

/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'company_status_id',
'postal_address_id',
'name',
'description',
'website_url',
'created_at',
'updated_at',
];

/**
* The attributes that are mass translatable.
*
* @var array<int, string>
*/
public $translatable = ['description'];
class Company extends Model
{
use HasFactory, HasTranslations;

/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'company_status_id',
'postal_address_id',
'name',
'description',
'website_url',
'created_at',
'updated_at',
];

/**
* The attributes that are mass translatable.
*
* @var array<int, string>
*/
public $translatable = ['description'];
class CompaniesResource extends CustomResource
{
use Translatable;

protected static ?string $model = Company::class;

protected static ?string $navigationIcon = 'heroicon-o-briefcase';

public static function form(Form $form): Form
{
return $form
->columns(3)
class CompaniesResource extends CustomResource
{
use Translatable;

protected static ?string $model = Company::class;

protected static ?string $navigationIcon = 'heroicon-o-briefcase';

public static function form(Form $form): Form
{
return $form
->columns(3)
1 Reply
Benjamin
Benjaminβ€’11mo ago
I just forgot to add uuid string in "fillable" array πŸ™ˆ Wait, nop. It is still there πŸ˜“