components([ TextInput::make('name') ->label('Name') ->required(), Select::make('organization_id') ->relationship(name: 'organization', titleAttribute: 'name') ->label('Organization') ->searchable(['name']) ->required(), ]); } public static function table(Table $table): Table { return $table ->columns([ TextColumn::make('name') ->label('Name') ->searchable() ->sortable(), TextColumn::make('organization.name') ->sortable() ->label('Organization'), TextColumn::make('created_at') ->label('Created at') ->sortable(), TextColumn::make('updated_at') ->label('Updated at') ->sortable(), ]) ->defaultSort('created_at', 'desc') ->filters([ SelectFilter::make('organization') ->label('Organization') ->relationship('organization', 'name') ->searchable(), SelectFilter::make('organization_id') ->label('Organization ID') ->relationship('organization', 'id') ->searchable(), ]) ->recordActions([ EditAction::make(), ]) ->toolbarActions([ BulkActionGroup::make([ DeleteBulkAction::make(), ]), ]); } public static function getRelations(): array { return [ // ]; } public static function getPages(): array { return [ 'index' => ListClients::route('/'), 'create' => CreateClient::route('/create'), 'edit' => EditClient::route('/{record}/edit'), ]; } }