*/ protected $fillable = [ 'account_id', 'name', 'translation_key', 'position', ]; /** * Get the account associated with the religion. * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\Account, $this> */ public function account(): BelongsTo { return $this->belongsTo(Account::class); } /** * Get the name of the religion. * The name is either the default name that we get from the translation key, * or the name that the user has entered. * * @return Attribute */ protected function name(): Attribute { return Attribute::make( get: function ($value, $attributes) { if (is_null($attributes['name'])) { return __($attributes['translation_key']); } return $attributes['name']; }, set: fn ($value) => $value, ); } }