schema([ TextInput::make('name') ->rules(['required', 'string', 'max:255']) ->unique(ignoreRecord: true), FileUpload::make('image') ->image() ->imageEditor() ->rules(['required', 'image']), Toggle::make('active') ->label('Is active') ->onColor('success') ->offColor('danger'), ]); } public static function table(Table $table): Table { return $table ->columns([ TextColumn::make('name') ->sortable() ->searchable(), ImageColumn::make('image') ->extraImgAttributes(['loading' => 'lazy']), ToggleColumn::make('active') ->label('Is active') ->onColor('success') ->offColor('danger'), ]) ->filters([ // ]) ->actions([ Tables\Actions\EditAction::make(), Tables\Actions\DeleteAction::make(), ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([ Tables\Actions\DeleteBulkAction::make(), ]), ]); } public static function getPages(): array { return [ 'index' => Pages\ManageBrands::route('/'), ]; } public static function canViewAny(): bool { return auth()->user()->role === UserRole::ADMIN || auth()->user()->role === UserRole::MANAGER; } }