Files
backend-umra/app/Filament/Resources/Hotels/HotelResource.php

63 lines
1.7 KiB
PHP

<?php
namespace App\Filament\Resources\Hotels;
use App\Filament\Resources\Hotels\Pages\CreateHotel;
use App\Filament\Resources\Hotels\Pages\EditHotel;
use App\Filament\Resources\Hotels\Pages\ListHotels;
use App\Filament\Resources\Hotels\Pages\ViewHotel;
use App\Filament\Resources\Hotels\RelationManagers\RoomsRelationManager;
use App\Filament\Resources\Hotels\Schemas\HotelForm;
use App\Filament\Resources\Hotels\Tables\HotelsTable;
use App\Models\Hotel;
use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Tables\Table;
class HotelResource extends Resource
{
protected static ?string $model = Hotel::class;
protected static ?string $navigationLabel = 'Otellar';
protected static ?string $pluralLabel = 'Otellar';
protected static ?string $modelLabel = 'Otel';
protected static ?string $recordTitleAttribute = 'name';
protected static ?int $navigationSort = 5;
protected static string|BackedEnum|null $navigationIcon = 'heroicon-o-building-office';
public static function form(Schema $schema): Schema
{
return $schema->schema(HotelForm::schema());
}
public static function table(Table $table): Table
{
return $table
->columns(HotelsTable::schema())
->actions(HotelsTable::actions());
}
public static function getRelations(): array
{
return [
RoomsRelationManager::class,
];
}
public static function getPages(): array
{
return [
'index' => ListHotels::route('/'),
'create' => CreateHotel::route('/create'),
'view' => ViewHotel::route('/{record}'),
'edit' => EditHotel::route('/{record}/edit'),
];
}
}