79 lines
2.2 KiB
PHP
79 lines
2.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Filament\Resources\SickLeaves;
|
|
|
|
use App\Enums\NavigationGroup;
|
|
use App\Filament\Resources\SickLeaves\Pages\CreateSickLeave;
|
|
use App\Filament\Resources\SickLeaves\Pages\EditSickLeave;
|
|
use App\Filament\Resources\SickLeaves\Pages\ListSickLeaves;
|
|
use App\Filament\Resources\SickLeaves\Pages\ViewSickLeave;
|
|
use App\Filament\Resources\SickLeaves\Schemas\SickLeaveForm;
|
|
use App\Filament\Resources\SickLeaves\Schemas\SickLeaveInfolist;
|
|
use App\Filament\Resources\SickLeaves\Tables\SickLeavesTable;
|
|
use App\Models\SickLeave;
|
|
use BackedEnum;
|
|
use UnitEnum;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Schemas\Schema;
|
|
use Filament\Support\Icons\Heroicon;
|
|
use Filament\Tables\Table;
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
|
|
|
class SickLeaveResource extends Resource
|
|
{
|
|
protected static ?string $model = SickLeave::class;
|
|
|
|
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedHeart;
|
|
|
|
protected static string|UnitEnum|null $navigationGroup = NavigationGroup::LeaveManagement;
|
|
|
|
protected static ?int $navigationSort = 2;
|
|
|
|
protected static ?string $recordTitleAttribute = 'id';
|
|
|
|
protected static bool $isGloballySearchable = false;
|
|
|
|
public static function form(Schema $schema): Schema
|
|
{
|
|
return SickLeaveForm::configure($schema);
|
|
}
|
|
|
|
public static function infolist(Schema $schema): Schema
|
|
{
|
|
return SickLeaveInfolist::configure($schema);
|
|
}
|
|
|
|
public static function table(Table $table): Table
|
|
{
|
|
return SickLeavesTable::configure($table);
|
|
}
|
|
|
|
public static function getRelations(): array
|
|
{
|
|
return [
|
|
//
|
|
];
|
|
}
|
|
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => ListSickLeaves::route('/'),
|
|
'create' => CreateSickLeave::route('/create'),
|
|
'view' => ViewSickLeave::route('/{record}'),
|
|
'edit' => EditSickLeave::route('/{record}/edit'),
|
|
];
|
|
}
|
|
|
|
public static function getRecordRouteBindingEloquentQuery(): Builder
|
|
{
|
|
return parent::getRecordRouteBindingEloquentQuery()
|
|
->withoutGlobalScopes([
|
|
SoftDeletingScope::class,
|
|
]);
|
|
}
|
|
}
|