columns([ TextColumn::make('id')->label('#'), TextColumn::make('tipo')->label('Tipo'), TextColumn::make('cantidad')->label('Cantidad'), TextColumn::make('usuario.name')->label('Usuario'), TextColumn::make('notas')->limit(80)->wrap(), TextColumn::make('created_at')->label('Fecha')->dateTime(), ]) ->filters([]) ->headerActions([ Tables\Actions\CreateAction::make()->form([ \Filament\Forms\Components\TextInput::make('cantidad')->numeric()->required()->minValue(1), \Filament\Forms\Components\Textarea::make('notas'), ])->action(function (array $data) { $owner = $this->getOwnerRecord(); try { $owner->registerArreglo((int)$data['cantidad'], $data['notas'] ?? null, auth()->id() ?? null); \Filament\Notifications\Notification::make()->success()->title('Arreglo registrado')->send(); } catch (\Throwable $e) { \Filament\Notifications\Notification::make()->danger()->title('Error')->body($e->getMessage())->send(); } }), ]) ->actions([]) ->bulkActions([]); } }