feat: add UserResource with is_admin toggle and delete
User management resource with editable is_admin field, postcode support, admin filter, and inline delete action. Includes list and edit pages. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Resources;
|
||||
|
||||
use App\Filament\NavigationGroup;
|
||||
use App\Filament\Resources\StationResource\Pages\ListStations;
|
||||
use App\Filament\Resources\StationResource\Pages\ViewStation;
|
||||
use App\Models\Station;
|
||||
@@ -20,9 +21,7 @@ class StationResource extends Resource
|
||||
{
|
||||
protected static ?string $model = Station::class;
|
||||
|
||||
protected static string|\BackedEnum|null $navigationIcon = 'heroicon-o-map-pin';
|
||||
|
||||
protected static string|\UnitEnum|null $navigationGroup = 'Data';
|
||||
protected static string|\UnitEnum|null $navigationGroup = NavigationGroup::Data;
|
||||
|
||||
protected static ?string $navigationLabel = 'Stations';
|
||||
|
||||
@@ -32,10 +31,13 @@ class StationResource extends Resource
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('trading_name')->searchable()->sortable(),
|
||||
TextColumn::make('trading_name')->searchable()->sortable()
|
||||
->limit(25)
|
||||
->tooltip(fn (Station $record) => strlen($record->trading_name) > 45 ? $record->trading_name : null),
|
||||
TextColumn::make('brand_name')->searchable()->placeholder('—'),
|
||||
TextColumn::make('postcode')->searchable(),
|
||||
TextColumn::make('city'),
|
||||
TextColumn::make('city')
|
||||
->description(fn (Station $record) => $record->postcode)
|
||||
->searchable(['city', 'postcode']),
|
||||
IconColumn::make('is_supermarket')->label('Supermarket')->boolean(),
|
||||
IconColumn::make('is_motorway_service_station')->label('Motorway')->boolean(),
|
||||
IconColumn::make('temporary_closure')
|
||||
|
||||
Reference in New Issue
Block a user