54 lines
1.4 KiB
PHP
54 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Providers;
|
|
|
|
use App\Filament\Clusters\Maintenance\MaintenanceCluster;
|
|
use App\Filament\Resources\Providers\Pages\ListProviders;
|
|
use App\Filament\Resources\Providers\Schemas\ProviderForm;
|
|
use App\Filament\Resources\Providers\Tables\ProvidersTable;
|
|
use App\Models\Provider;
|
|
use BackedEnum;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Schemas\Schema;
|
|
use Filament\Tables\Table;
|
|
use UnitEnum;
|
|
|
|
class ProviderResource extends Resource
|
|
{
|
|
protected static ?string $model = Provider::class;
|
|
|
|
protected static string|BackedEnum|null $navigationIcon = 'lucide-arrow-down-up';
|
|
|
|
protected static ?string $recordTitleAttribute = 'name';
|
|
|
|
protected static ?string $navigationLabel = 'Provider';
|
|
|
|
protected static ?string $pluralLabel = 'Providers';
|
|
|
|
protected static string|UnitEnum|null $navigationGroup = 'Administration';
|
|
|
|
protected static ?string $cluster = MaintenanceCluster::class;
|
|
|
|
public static function form(Schema $schema): Schema
|
|
{
|
|
return ProviderForm::configure($schema);
|
|
}
|
|
|
|
public static function table(Table $table): Table
|
|
{
|
|
return ProvidersTable::configure($table);
|
|
}
|
|
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => ListProviders::route('/'),
|
|
];
|
|
}
|
|
|
|
public static function getNavigationBadge(): ?string
|
|
{
|
|
return parent::getEloquentQuery()->count();
|
|
}
|
|
}
|