*/ protected $fillable = [ 'vault_id', 'label', 'label_translation_key', 'position', ]; /** * Get the vault associated with the quick fact template. * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\Vault, $this> */ public function vault(): BelongsTo { return $this->belongsTo(Vault::class); } /** * Get the label attribute. * Vault quick fact template entries have a default label that can be translated. * Howerer, if a label is set, it will be used instead of the default. * * @return Attribute */ protected function label(): Attribute { return Attribute::make( get: function ($value, $attributes) { if (! $value) { return __($attributes['label_translation_key']); } return $value; }, set: fn ($value) => $value, ); } }