components([ DatePicker::make('report_date') ->required() ->default(now()), TextInput::make('title') ->required() ->maxLength(255), Textarea::make('description') ->required() ->rows(4) ->columnSpanFull(), Select::make('severity') ->options(DisciplinarySeverity::class) ->required() ->native(false), HrForm::fileUpload('attachment_path') ->label('Attachment') ->acceptedFileTypes(['application/pdf', 'image/*']) ->maxSize(10240), ]); } public function table(Table $table): Table { return $table ->recordTitleAttribute('title') ->columns([ TextColumn::make('report_date') ->date() ->sortable(), TextColumn::make('title') ->searchable() ->sortable(), TextColumn::make('severity') ->badge() ->color(fn (DisciplinarySeverity $state): string => $state->color()) ->formatStateUsing(fn (DisciplinarySeverity $state): string => $state->label()) ->sortable(), IconColumn::make('attachment_path') ->label('Attachment') ->boolean() ->trueIcon('heroicon-o-paper-clip') ->falseIcon('heroicon-o-minus'), TextColumn::make('creator.name') ->label('Created By') ->toggleable(), ]) ->filters([ SelectFilter::make('severity') ->options(DisciplinarySeverity::class), TrashedFilter::make(), ]) ->headerActions([ CreateAction::make(), ]) ->recordActions([ EditAction::make(), DeleteAction::make(), ]) ->toolbarActions([ BulkActionGroup::make([ DeleteBulkAction::make(), ForceDeleteBulkAction::make(), RestoreBulkAction::make(), ]), ]); } }