feat: initial project setup with Laravel 12 and Filament v4
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\PatientResource\Pages;
|
||||
|
||||
use App\Filament\Resources\PatientResource;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
use Filament\Support\Enums\Width;
|
||||
|
||||
class CreatePatient extends CreateRecord
|
||||
{
|
||||
protected static string $resource = PatientResource::class;
|
||||
|
||||
protected Width|string|null $maxContentWidth = Width::SevenExtraLarge;
|
||||
|
||||
protected function getFormActions(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\PatientResource\Pages;
|
||||
|
||||
use App\Filament\Resources\PatientResource;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
use Filament\Support\Enums\Width;
|
||||
|
||||
class EditPatient extends EditRecord
|
||||
{
|
||||
protected static string $resource = PatientResource::class;
|
||||
|
||||
protected Width|string|null $maxContentWidth = Width::SevenExtraLarge;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Action::make('printPrescription')
|
||||
->label(__('prescriptions.actions.print_prescription'))
|
||||
->icon('heroicon-o-printer')
|
||||
->color('info')
|
||||
->visible(fn () => $this->getRecord()->prescriptions()->exists())
|
||||
->url(fn () => route('prescription.print', $this->getRecord()->prescriptions()->latest()->first()))
|
||||
->openUrlInNewTab(),
|
||||
|
||||
Action::make('printAdmission')
|
||||
->label(__('prescriptions.actions.print_admission'))
|
||||
->icon('heroicon-o-printer')
|
||||
->color('warning')
|
||||
->visible(fn () => $this->getRecord()->surgeryAppointment !== null)
|
||||
->url(fn () => route('surgery-appointment.print.admission', $this->getRecord()))
|
||||
->openUrlInNewTab(),
|
||||
|
||||
Action::make('printLab')
|
||||
->label(__('prescriptions.actions.print_lab'))
|
||||
->icon('heroicon-o-beaker')
|
||||
->color('gray')
|
||||
->url(fn () => route('patient.print.lab', $this->getRecord()))
|
||||
->openUrlInNewTab(),
|
||||
|
||||
DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
|
||||
protected function getFormActions(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\PatientResource\Pages;
|
||||
|
||||
use App\Filament\Resources\PatientResource;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
use Filament\Support\Enums\Width;
|
||||
|
||||
class ListPatients extends ListRecords
|
||||
{
|
||||
protected static string $resource = PatientResource::class;
|
||||
|
||||
protected Width|string|null $maxContentWidth = Width::Full;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
CreateAction::make()
|
||||
->icon('heroicon-o-plus'),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user