belongsTo(Employee::class); } public function type(): BelongsTo { return $this->belongsTo(Keyword::class, 'reimbursement_type_id', 'key'); } protected function photos(): Attribute { return Attribute::make( get: function (mixed $value) { if (! is_array($photos = json_decode($value ?? '', true))) { $photos = []; } return $photos; }, set: fn (mixed $value) => json_encode(is_array($value) ? $value : []), ); } }