adrema/app/Gender.php

25 lines
473 B
PHP
Raw Permalink Normal View History

2020-04-12 00:26:44 +02:00
<?php
namespace App;
2021-11-17 22:32:52 +01:00
use App\Nami\HasNamiField;
2022-08-12 22:07:59 +02:00
use Illuminate\Database\Eloquent\Factories\HasFactory;
2020-04-12 00:26:44 +02:00
use Illuminate\Database\Eloquent\Model;
class Gender extends Model
{
2021-11-17 22:32:52 +01:00
use HasNamiField;
2022-08-12 22:07:59 +02:00
use HasFactory;
2021-11-17 22:32:52 +01:00
2021-04-11 17:02:49 +02:00
public $fillable = ['name', 'nami_id'];
2022-11-19 00:21:58 +01:00
public function getSalutationAttribute(): string
{
return match ($this->name) {
'Männlich' => 'Herr',
'Weiblich' => 'Frau',
default => ''
};
}
2020-04-12 00:26:44 +02:00
}