51 lines
1.3 KiB
PHP
51 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Links;
|
|
|
|
use App\Filament\Resources\Links\Pages\CreateLink;
|
|
use App\Filament\Resources\Links\Pages\EditLink;
|
|
use App\Filament\Resources\Links\Pages\ListLinks;
|
|
use App\Filament\Resources\Links\Schemas\LinkForm;
|
|
use App\Filament\Resources\Links\Tables\LinksTable;
|
|
use App\Models\Link;
|
|
use BackedEnum;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Schemas\Schema;
|
|
use Filament\Support\Icons\Heroicon;
|
|
use Filament\Tables\Table;
|
|
|
|
class LinkResource extends Resource
|
|
{
|
|
protected static \UnitEnum|string|null $navigationGroup = '管理';
|
|
|
|
protected static ?string $model = Link::class;
|
|
|
|
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
|
|
|
|
public static function form(Schema $schema): Schema
|
|
{
|
|
return LinkForm::configure($schema);
|
|
}
|
|
|
|
public static function table(Table $table): Table
|
|
{
|
|
return LinksTable::configure($table);
|
|
}
|
|
|
|
public static function getRelations(): array
|
|
{
|
|
return [
|
|
//
|
|
];
|
|
}
|
|
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => ListLinks::route('/'),
|
|
'create' => CreateLink::route('/create'),
|
|
'edit' => EditLink::route('/{record}/edit'),
|
|
];
|
|
}
|
|
}
|