components([ Select::make('family_id')->label('Allow family') ->relationship('family', 'family')->required()->label(__('label.agent_allow.family')), TextInput::make('name')->required()->label(__('label.name')), TextInput::make('peer_id')->required()->label(__('label.agent_deny.peer_id')), TextInput::make('agent')->required()->label(__('label.agent_deny.agent')), Textarea::make('comment')->label(__('label.comment')), ]); } public static function table(Table $table): Table { return $table ->columns([ TextColumn::make('id')->sortable(), TextColumn::make('family.family')->label(__('label.agent_allow.family')), TextColumn::make('name')->searchable()->label(__('label.name')), TextColumn::make('peer_id')->searchable()->label(__('label.agent_deny.peer_id')), TextColumn::make('agent')->searchable()->label(__('label.agent_deny.agent')), ]) ->defaultSort('id', 'desc') ->filters([ // ]) ->recordActions([ EditAction::make(), DeleteAction::make()->using(function ($record) { $record->delete(); clear_agent_allow_deny_cache(); return redirect(self::getUrl()); }) ]) ->toolbarActions([ DeleteBulkAction::make(), ]); } public static function getRelations(): array { return [ // ]; } public static function getPages(): array { return [ 'index' => ListAgentDenies::route('/'), 'create' => CreateAgentDeny::route('/create'), 'edit' => EditAgentDeny::route('/{record}/edit'), ]; } }