Files
fuel-price/app/Filament/Resources/BrentPriceResource.php
Ovidiu U c2c16c928b
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (8.3) (push) Has been cancelled
tests / ci (8.4) (push) Has been cancelled
tests / ci (8.5) (push) Has been cancelled
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>
2026-04-04 18:31:55 +01:00

46 lines
1.2 KiB
PHP

<?php
namespace App\Filament\Resources;
use App\Filament\NavigationGroup;
use App\Filament\Resources\BrentPriceResource\Pages\ListBrentPrices;
use App\Models\BrentPrice;
use Filament\Resources\Resource;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Table;
class BrentPriceResource extends Resource
{
protected static ?string $model = BrentPrice::class;
protected static string|\UnitEnum|null $navigationGroup = NavigationGroup::Data;
protected static ?string $navigationLabel = 'Brent Prices';
protected static ?int $navigationSort = 2;
public static function table(Table $table): Table
{
return $table
->columns([
TextColumn::make('date')
->date('d M Y')
->sortable(),
TextColumn::make('price_usd')
->label('Price (USD/barrel)')
->numeric(2)
->sortable(),
])
->defaultSort('date', 'desc')
->recordActions([])
->filters([]);
}
public static function getPages(): array
{
return [
'index' => ListBrentPrices::route('/'),
];
}
}