'date', 'gender' => Gender::class, ]; } // 3. Attribute public function birthDateFormatted(): Attribute { return Attribute::make( get: fn () => $this->birth_date ? Carbon::parse($this->birth_date)->translatedFormat('l, d F Y') : '-', ); } public function birthDateInput(): Attribute { return Attribute::make( get: fn () => $this->birth_date?->format('Y-m-d'), ); } public function genderLabel(): Attribute { return Attribute::make( get: fn () => $this->gender?->label() ?? '-', ); } public function profilePhotoUrl(): Attribute { return Attribute::make( get: fn () => $this->getFirstMediaUrl('profile_photo') ?: null, ); } // 4. Other Methods public static function mediaModuleName(): string { return 'user-profile'; } public function registerMediaCollections(): void { $this->addMediaCollection('profile_photo')->singleFile(); } // 5. Relation public function user(): BelongsTo { return $this->belongsTo(User::class); } }