Files
Cybrarist b380665e0b make products clickable in links
remove delete button from link
remove image upload from link
2025-11-12 22:47:00 +04:00

56 lines
1.5 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\RelationManagers\NotificationSettingsRelationManager;
use App\Filament\Resources\Links\RelationManagers\ProductsRelationManager;
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 ?string $model = Link::class;
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
protected static ?string $recordTitleAttribute = 'name';
protected static ?int $navigationSort = 2;
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 [
ProductsRelationManager::class,
NotificationSettingsRelationManager::class,
];
}
public static function getPages(): array
{
return [
'index' => ListLinks::route('/'),
'create' => CreateLink::route('/create'),
'edit' => EditLink::route('/{record}/edit'),
];
}
}