51 lines
1.3 KiB
PHP
51 lines
1.3 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Filament\Resources\Categroys;
|
||
|
|
|
||
|
|
use App\Filament\Resources\Categroys\Pages\CreateCategroy;
|
||
|
|
use App\Filament\Resources\Categroys\Pages\EditCategroy;
|
||
|
|
use App\Filament\Resources\Categroys\Pages\ListCategroys;
|
||
|
|
use App\Filament\Resources\Categroys\Schemas\CategroyForm;
|
||
|
|
use App\Filament\Resources\Categroys\Tables\CategroysTable;
|
||
|
|
use App\Models\Category;
|
||
|
|
use BackedEnum;
|
||
|
|
use Filament\Resources\Resource;
|
||
|
|
use Filament\Schemas\Schema;
|
||
|
|
use Filament\Support\Icons\Heroicon;
|
||
|
|
use Filament\Tables\Table;
|
||
|
|
|
||
|
|
class CategroyResource extends Resource
|
||
|
|
{
|
||
|
|
protected static ?string $model = Category::class;
|
||
|
|
|
||
|
|
protected static string|BackedEnum|null $navigationIcon = Heroicon::RectangleGroup;
|
||
|
|
|
||
|
|
protected static ?string $recordTitleAttribute = 'name';
|
||
|
|
|
||
|
|
public static function form(Schema $schema): Schema
|
||
|
|
{
|
||
|
|
return CategroyForm::configure($schema);
|
||
|
|
}
|
||
|
|
|
||
|
|
public static function table(Table $table): Table
|
||
|
|
{
|
||
|
|
return CategroysTable::configure($table);
|
||
|
|
}
|
||
|
|
|
||
|
|
public static function getRelations(): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
//
|
||
|
|
];
|
||
|
|
}
|
||
|
|
|
||
|
|
public static function getPages(): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'index' => ListCategroys::route('/'),
|
||
|
|
'create' => CreateCategroy::route('/create'),
|
||
|
|
'edit' => EditCategroy::route('/{record}/edit'),
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|