matab-panel/app/Models/Doctor.php

32 lines
584 B
PHP

<?php
declare(strict_types=1);
namespace App\Models;
use App\Casts\JalaliDatetime;
use Illuminate\Database\Eloquent\Model;
class Doctor extends Model
{
protected $fillable = [
'first_name',
'last_name',
'speciality',
'license_id',
];
protected function casts(): array
{
return [
'created_at' => JalaliDatetime::class,
'updated_at' => JalaliDatetime::class,
];
}
public function getFullNameAttribute(): string
{
return $this->first_name . ' ' . $this->last_name;
}
}