Initial commit
This commit is contained in:
61
app/Filament/Resources/Photos/PhotoResource.php
Normal file
61
app/Filament/Resources/Photos/PhotoResource.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Photos;
|
||||
|
||||
use App\Filament\Resources\Photos\Pages\CreatePhoto;
|
||||
use App\Filament\Resources\Photos\Pages\EditPhoto;
|
||||
use App\Filament\Resources\Photos\Pages\ListPhotos;
|
||||
use App\Filament\Resources\Photos\Pages\ViewPhoto;
|
||||
use App\Filament\Resources\Photos\Schemas\PhotoForm;
|
||||
use App\Filament\Resources\Photos\Schemas\PhotoInfolist;
|
||||
use App\Filament\Resources\Photos\Tables\PhotosTable;
|
||||
use App\Models\Photo;
|
||||
use BackedEnum;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class PhotoResource extends Resource
|
||||
{
|
||||
protected static ?string $model = Photo::class;
|
||||
|
||||
protected static string | \BackedEnum | null $navigationIcon = 'heroicon-o-photo';
|
||||
protected static string | \UnitEnum | null $navigationGroup = 'Treść';
|
||||
protected static ?string $pluralModelLabel = 'Galeria';
|
||||
protected static ?string $modelLabel = 'Zdjęcie';
|
||||
protected static ?int $navigationSort = 4;
|
||||
protected static ?string $recordTitleAttribute = 'Zdjęcie';
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return PhotoForm::configure($schema);
|
||||
}
|
||||
|
||||
public static function infolist(Schema $schema): Schema
|
||||
{
|
||||
return PhotoInfolist::configure($schema);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return PhotosTable::configure($table);
|
||||
}
|
||||
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => ListPhotos::route('/'),
|
||||
'create' => CreatePhoto::route('/create'),
|
||||
'view' => ViewPhoto::route('/{record}'),
|
||||
'edit' => EditPhoto::route('/{record}/edit'),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user