matab-panel/app/Models/Doctor.php

34 lines
648 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',
'is_default',
];
protected function casts(): array
{
return [
'is_default' => 'boolean',
'created_at' => JalaliDatetime::class,
'updated_at' => JalaliDatetime::class,
];
}
public function getFullNameAttribute(): string
{
return $this->first_name . ' ' . $this->last_name;
}
}