feat: initial project setup with Laravel 12 and Filament v4
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Casts\JalaliDatetime;
|
||||
use App\Traits\HasUserStamps;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class Prescription extends Model
|
||||
{
|
||||
use HasUserStamps;
|
||||
|
||||
protected $fillable = [
|
||||
'patient',
|
||||
'issue_date',
|
||||
'issue_datetime',
|
||||
'doctor',
|
||||
'medication_ids',
|
||||
'content',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'issue_datetime' => 'datetime',
|
||||
'medication_ids' => 'array',
|
||||
'created_at' => JalaliDatetime::class,
|
||||
'updated_at' => JalaliDatetime::class,
|
||||
];
|
||||
}
|
||||
|
||||
public function patientRecord(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Patient::class, 'patient');
|
||||
}
|
||||
|
||||
public function creator(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'created_by');
|
||||
}
|
||||
|
||||
public function updator(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'updated_by');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user