base commit
This commit is contained in:
11
app/Filament/Resources/Employees/Pages/CreateEmployee.php
Normal file
11
app/Filament/Resources/Employees/Pages/CreateEmployee.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Employees\Pages;
|
||||
|
||||
use App\Filament\Resources\Employees\EmployeeResource;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateEmployee extends CreateRecord
|
||||
{
|
||||
protected static string $resource = EmployeeResource::class;
|
||||
}
|
||||
25
app/Filament/Resources/Employees/Pages/EditEmployee.php
Normal file
25
app/Filament/Resources/Employees/Pages/EditEmployee.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Employees\Pages;
|
||||
|
||||
use App\Filament\Resources\Employees\EmployeeResource;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Actions\ForceDeleteAction;
|
||||
use Filament\Actions\RestoreAction;
|
||||
use Filament\Actions\ViewAction;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditEmployee extends EditRecord
|
||||
{
|
||||
protected static string $resource = EmployeeResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
ViewAction::make(),
|
||||
DeleteAction::make(),
|
||||
ForceDeleteAction::make(),
|
||||
RestoreAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
26
app/Filament/Resources/Employees/Pages/ListEmployees.php
Normal file
26
app/Filament/Resources/Employees/Pages/ListEmployees.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Employees\Pages;
|
||||
|
||||
use App\Exports\EmployeesExport;
|
||||
use App\Filament\Resources\Employees\EmployeeResource;
|
||||
use App\Filament\Support\ExportExcelAction;
|
||||
use App\Filament\Support\ExportPdfAction;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListEmployees extends ListRecords
|
||||
{
|
||||
protected static string $resource = EmployeeResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
ExportExcelAction::make('export', EmployeesExport::class, 'employees.xlsx'),
|
||||
ExportPdfAction::employeeList(),
|
||||
CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
47
app/Filament/Resources/Employees/Pages/ViewEmployee.php
Normal file
47
app/Filament/Resources/Employees/Pages/ViewEmployee.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Employees\Pages;
|
||||
|
||||
use App\Filament\Resources\Employees\EmployeeResource;
|
||||
use App\Filament\Resources\Employees\Widgets\EmployeeStatsWidget;
|
||||
use App\Filament\Support\ExportPdfAction;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Resources\Pages\ViewRecord;
|
||||
|
||||
class ViewEmployee extends ViewRecord
|
||||
{
|
||||
protected static string $resource = EmployeeResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
ExportPdfAction::employeeProfile(),
|
||||
ExportPdfAction::employeeLeaveSummary(),
|
||||
EditAction::make(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<class-string>
|
||||
*/
|
||||
protected function getHeaderWidgets(): array
|
||||
{
|
||||
return [
|
||||
EmployeeStatsWidget::class,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int | array<string, ?int>
|
||||
*/
|
||||
public function getHeaderWidgetsColumns(): int | array
|
||||
{
|
||||
return [
|
||||
'default' => 1,
|
||||
'sm' => 2,
|
||||
'xl' => 4,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user