feat: patient view, media player, and rich editor enhancements
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
use App\Filament\Resources\PatientResource\Pages\CreatePatient;
|
||||
use App\Filament\Resources\PatientResource\Pages\EditPatient;
|
||||
use App\Filament\Resources\PatientResource\Pages\ViewPatient;
|
||||
use App\Models\Doctor;
|
||||
use App\Models\PaymentType;
|
||||
use App\Models\Treatment;
|
||||
@@ -32,7 +33,7 @@ class VisitsRelationManager extends RelationManager
|
||||
|
||||
public static function canViewForRecord(\Illuminate\Database\Eloquent\Model $ownerRecord, string $pageClass): bool
|
||||
{
|
||||
return in_array($pageClass, [CreatePatient::class, EditPatient::class]);
|
||||
return in_array($pageClass, [CreatePatient::class, EditPatient::class, ViewPatient::class]);
|
||||
}
|
||||
|
||||
public static function getTitle(\Illuminate\Database\Eloquent\Model $ownerRecord, string $pageClass): string
|
||||
@@ -136,6 +137,18 @@ public function form(Schema $schema): Schema
|
||||
]);
|
||||
}
|
||||
|
||||
private static function jalaliDate(?string $date): string
|
||||
{
|
||||
if (! $date) {
|
||||
return '-';
|
||||
}
|
||||
try {
|
||||
return \Morilog\Jalali\Jalalian::fromCarbon(\Carbon\Carbon::parse($date))->format('Y/m/d');
|
||||
} catch (\Exception $e) {
|
||||
return $date;
|
||||
}
|
||||
}
|
||||
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
@@ -219,8 +232,10 @@ public function table(Table $table): Table
|
||||
->recordActions([
|
||||
EditAction::make()
|
||||
->slideOver()
|
||||
->modalWidth('4xl'),
|
||||
DeleteAction::make(),
|
||||
->modalWidth('4xl')
|
||||
->modalHeading(fn () => __('filament-actions::edit.single.modal.heading', ['label' => $this->getOwnerRecord()->full_name])),
|
||||
DeleteAction::make()
|
||||
->modalHeading(fn () => __('filament-actions::delete.single.modal.heading', ['label' => $this->getOwnerRecord()->full_name])),
|
||||
])
|
||||
->toolbarActions([]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user