Add [name] to fillable property to allow mass assignment on [App\Models\Country].

<?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Astrotomic\Translatable\Contracts\Translatable as TranslatableContract; use Astrotomic\Translatable\Translatable; class Country extends Model implements TranslatableContract { use HasFactory; use Translatable; protected $with = ['translations']; public $translatedAttributes = ['name']; } <?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class CountryTranslation extends Model { use HasFactory; protected $fillable = [ 'name','locale' ,'country_id', ]; public $timestamps = false; }
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server