Refactor navigation icon declarations in various resources for consistency; enhance Group model with new relationships and fillable properties; update Hotel and Pilgrim models with fillable attributes; improve table configurations across resources.
This commit is contained in:
@@ -24,7 +24,7 @@ class DocumentResource extends Resource
|
||||
|
||||
protected static ?int $navigationSort = 4;
|
||||
|
||||
public static function getNavigationIcon(): string | BackedEnum | Htmlable | null
|
||||
public static function getNavigationIcon(): string|BackedEnum|Htmlable|null
|
||||
{
|
||||
return 'heroicon-o-document-text';
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ class DocumentsTable
|
||||
->searchable(),
|
||||
TextColumn::make('file')
|
||||
->searchable(),
|
||||
|
||||
|
||||
TextColumn::make('created_at')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
|
||||
@@ -6,6 +6,7 @@ use App\Filament\Resources\Groups\Pages\CreateGroup;
|
||||
use App\Filament\Resources\Groups\Pages\EditGroup;
|
||||
use App\Filament\Resources\Groups\Pages\ListGroups;
|
||||
use App\Filament\Resources\Groups\RelationManagers\PilgrimsRelationManager;
|
||||
use App\Filament\Resources\Groups\RelationManagers\ProgramRelationManager;
|
||||
use App\Filament\Resources\Groups\Schemas\GroupForm;
|
||||
use App\Filament\Resources\Groups\Tables\GroupsTable;
|
||||
use App\Models\Group;
|
||||
@@ -26,7 +27,7 @@ class GroupResource extends Resource
|
||||
|
||||
protected static ?int $navigationSort = 1;
|
||||
|
||||
protected static string | BackedEnum | null $navigationIcon = 'icon-flight-takeoff';
|
||||
protected static string|BackedEnum|null $navigationIcon = 'icon-flight-takeoff';
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
@@ -42,6 +43,7 @@ class GroupResource extends Resource
|
||||
{
|
||||
return [
|
||||
PilgrimsRelationManager::class,
|
||||
ProgramRelationManager::class,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Groups\RelationManagers;
|
||||
|
||||
use Filament\Actions\AssociateAction;
|
||||
use Filament\Actions\BulkActionGroup;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Actions\DeleteBulkAction;
|
||||
use Filament\Actions\DissociateAction;
|
||||
use Filament\Actions\DissociateBulkAction;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class ProgramRelationManager extends RelationManager
|
||||
{
|
||||
protected static string $relationship = 'program';
|
||||
|
||||
public function form(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
TextInput::make('title')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
]);
|
||||
}
|
||||
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->recordTitleAttribute('title')
|
||||
->columns([
|
||||
TextColumn::make('title')
|
||||
->searchable(),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->headerActions([
|
||||
CreateAction::make(),
|
||||
AssociateAction::make(),
|
||||
])
|
||||
->recordActions([
|
||||
EditAction::make(),
|
||||
DissociateAction::make(),
|
||||
DeleteAction::make(),
|
||||
])
|
||||
->toolbarActions([
|
||||
BulkActionGroup::make([
|
||||
DissociateBulkAction::make(),
|
||||
DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -17,12 +17,15 @@ class GroupForm
|
||||
->components([
|
||||
DatePicker::make('start_date')
|
||||
->label('Başlanýan senesi')
|
||||
->native(false)
|
||||
->required()
|
||||
->live()
|
||||
->afterStateUpdated(fn(Set $set, ?string $state) => $set('end_date', $state ? Carbon::parse($state)->addDays(14)->format('Y-m-d') : null)),
|
||||
->afterStateUpdated(fn (Set $set, ?string $state) => $set('end_date', $state ? Carbon::parse($state)->addDays(14)->format('Y-m-d') : null))
|
||||
->rules('unique:groups,start_date'),
|
||||
|
||||
DatePicker::make('end_date')
|
||||
->label('Gutarýan senesi')
|
||||
->native(false)
|
||||
->required(),
|
||||
|
||||
Select::make('leader_teacher_id')
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Filament\Resources\Groups\Tables;
|
||||
|
||||
use Filament\Actions\BulkActionGroup;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Actions\DeleteBulkAction;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
@@ -33,7 +34,7 @@ class GroupsTable
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
|
||||
|
||||
TextColumn::make('updated_at')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
@@ -43,7 +44,11 @@ class GroupsTable
|
||||
//
|
||||
])
|
||||
->recordActions([
|
||||
EditAction::make(),
|
||||
EditAction::make()
|
||||
->iconButton(),
|
||||
|
||||
DeleteAction::make()
|
||||
->iconButton(),
|
||||
])
|
||||
->toolbarActions([
|
||||
BulkActionGroup::make([
|
||||
|
||||
@@ -5,6 +5,7 @@ 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;
|
||||
@@ -12,7 +13,6 @@ use App\Models\Hotel;
|
||||
use BackedEnum;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class HotelResource extends Resource
|
||||
@@ -22,13 +22,14 @@ class HotelResource extends Resource
|
||||
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';
|
||||
protected static string|BackedEnum|null $navigationIcon = 'heroicon-o-building-office';
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
@@ -37,7 +38,9 @@ class HotelResource extends Resource
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return $table->columns(HotelsTable::schema());
|
||||
return $table
|
||||
->columns(HotelsTable::schema())
|
||||
->actions(HotelsTable::actions());
|
||||
}
|
||||
|
||||
public static function getRelations(): array
|
||||
@@ -52,6 +55,7 @@ class HotelResource extends Resource
|
||||
return [
|
||||
'index' => ListHotels::route('/'),
|
||||
'create' => CreateHotel::route('/create'),
|
||||
'view' => ViewHotel::route('/{record}'),
|
||||
'edit' => EditHotel::route('/{record}/edit'),
|
||||
];
|
||||
}
|
||||
|
||||
26
app/Filament/Resources/Hotels/Pages/ViewHotel.php
Normal file
26
app/Filament/Resources/Hotels/Pages/ViewHotel.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Hotels\Pages;
|
||||
|
||||
use App\Filament\Resources\Hotels\HotelResource;
|
||||
use App\Filament\Resources\Hotels\Schemas\HotelInfolist;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\ViewRecord;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class ViewHotel extends ViewRecord
|
||||
{
|
||||
protected static string $resource = HotelResource::class;
|
||||
|
||||
public function infolist(Schema $schema): Schema
|
||||
{
|
||||
return HotelInfolist::configure($schema);
|
||||
}
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\EditAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ class HotelForm
|
||||
return [
|
||||
Forms\Components\TextInput::make('name')
|
||||
->required(),
|
||||
|
||||
|
||||
Forms\Components\Select::make('city')
|
||||
->options([
|
||||
'Makkah' => 'Makkah',
|
||||
|
||||
24
app/Filament/Resources/Hotels/Schemas/HotelInfolist.php
Normal file
24
app/Filament/Resources/Hotels/Schemas/HotelInfolist.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Hotels\Schemas;
|
||||
|
||||
use Filament\Infolists;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class HotelInfolist
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema->components([
|
||||
Infolists\Components\TextEntry::make('name'),
|
||||
Infolists\Components\TextEntry::make('city'),
|
||||
Infolists\Components\ImageEntry::make('image')
|
||||
->columnSpanFull(),
|
||||
Infolists\Components\ImageEntry::make('images')
|
||||
->columnSpanFull(),
|
||||
Infolists\Components\TextEntry::make('geo_location'),
|
||||
Infolists\Components\TextEntry::make('haram_distance'),
|
||||
Infolists\Components\TextEntry::make('star'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace App\Filament\Resources\Hotels\Tables;
|
||||
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Actions\ViewAction;
|
||||
use Filament\Tables;
|
||||
|
||||
class HotelsTable
|
||||
@@ -35,4 +37,12 @@ class HotelsTable
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
];
|
||||
}
|
||||
|
||||
public static function actions(): array
|
||||
{
|
||||
return [
|
||||
ViewAction::make(),
|
||||
EditAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,8 +12,6 @@ use App\Models\Pilgrim;
|
||||
use BackedEnum;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Illuminate\Contracts\Support\Htmlable;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class PilgrimResource extends Resource
|
||||
@@ -21,10 +19,13 @@ class PilgrimResource extends Resource
|
||||
protected static ?string $model = Pilgrim::class;
|
||||
|
||||
protected static ?int $navigationSort = 2;
|
||||
|
||||
protected static ?string $navigationLabel = 'Zyýaratçylar';
|
||||
protected static string | BackedEnum | null $navigationIcon = 'icon-pilgrim-man';
|
||||
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = 'icon-pilgrim-man';
|
||||
|
||||
protected static ?string $modelLabel = 'Zyýaratçy';
|
||||
|
||||
protected static ?string $pluralLabel = 'Zyýaratçylar';
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
|
||||
@@ -30,7 +30,7 @@ class PilgrimsTable
|
||||
|
||||
TextColumn::make('international_passport')
|
||||
->searchable(),
|
||||
|
||||
|
||||
TextColumn::make('created_at')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
|
||||
11
app/Filament/Resources/Programs/Pages/CreateProgram.php
Normal file
11
app/Filament/Resources/Programs/Pages/CreateProgram.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Programs\Pages;
|
||||
|
||||
use App\Filament\Resources\Programs\ProgramResource;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateProgram extends CreateRecord
|
||||
{
|
||||
protected static string $resource = ProgramResource::class;
|
||||
}
|
||||
21
app/Filament/Resources/Programs/Pages/EditProgram.php
Normal file
21
app/Filament/Resources/Programs/Pages/EditProgram.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Programs\Pages;
|
||||
|
||||
use App\Filament\Resources\Programs\ProgramResource;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Actions\ViewAction;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditProgram extends EditRecord
|
||||
{
|
||||
protected static string $resource = ProgramResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
ViewAction::make(),
|
||||
DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
19
app/Filament/Resources/Programs/Pages/ListPrograms.php
Normal file
19
app/Filament/Resources/Programs/Pages/ListPrograms.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Programs\Pages;
|
||||
|
||||
use App\Filament\Resources\Programs\ProgramResource;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListPrograms extends ListRecords
|
||||
{
|
||||
protected static string $resource = ProgramResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
19
app/Filament/Resources/Programs/Pages/ViewProgram.php
Normal file
19
app/Filament/Resources/Programs/Pages/ViewProgram.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Programs\Pages;
|
||||
|
||||
use App\Filament\Resources\Programs\ProgramResource;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Resources\Pages\ViewRecord;
|
||||
|
||||
class ViewProgram extends ViewRecord
|
||||
{
|
||||
protected static string $resource = ProgramResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
EditAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
46
app/Filament/Resources/Programs/ProgramResource.php
Normal file
46
app/Filament/Resources/Programs/ProgramResource.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Programs;
|
||||
|
||||
use App\Filament\Resources\Programs\Schemas\ProgramForm;
|
||||
use App\Filament\Resources\Programs\Tables\ProgramsTable;
|
||||
use App\Models\Program;
|
||||
use BackedEnum;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class ProgramResource extends Resource
|
||||
{
|
||||
protected static ?string $model = Program::class;
|
||||
|
||||
protected static ?string $navigationLabel = 'Programmalar';
|
||||
|
||||
protected static ?string $pluralLabel = 'Programmalar';
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'name';
|
||||
|
||||
protected static ?int $navigationSort = 7;
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = 'heroicon-o-calendar-days';
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return ProgramForm::configure($schema);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return ProgramsTable::configure($table);
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => Pages\ListPrograms::route('/'),
|
||||
'create' => Pages\CreateProgram::route('/create'),
|
||||
'edit' => Pages\EditProgram::route('/{record}/edit'),
|
||||
'view' => Pages\ViewProgram::route('/{record}'),
|
||||
];
|
||||
}
|
||||
}
|
||||
51
app/Filament/Resources/Programs/Schemas/ProgramForm.php
Normal file
51
app/Filament/Resources/Programs/Schemas/ProgramForm.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Programs\Schemas;
|
||||
|
||||
use Filament\Forms\Components\Repeater;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\TimePicker;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class ProgramForm
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
Select::make('group_id')
|
||||
->relationship('group', 'name')
|
||||
->label('Topar')
|
||||
->required(),
|
||||
Repeater::make('days')
|
||||
->label('Günler')
|
||||
->itemLabel(fn (array $state): ?string => ($state['day_number'] ?? '').'-nji gün')
|
||||
->schema([
|
||||
TextInput::make('day_number')
|
||||
->numeric()
|
||||
->required()
|
||||
->label('Günüň belgisi'),
|
||||
Repeater::make('actions')
|
||||
->label('Actionlar')
|
||||
->schema([
|
||||
TextInput::make('title')
|
||||
->label('Ady')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
Textarea::make('description')
|
||||
->label('Düşündirişi')
|
||||
->columnSpanFull(),
|
||||
TimePicker::make('time')
|
||||
->label('Wagty'),
|
||||
TextInput::make('icon')
|
||||
->label('Ikony')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
])
|
||||
->columns(2),
|
||||
])->columnSpanFull(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
21
app/Filament/Resources/Programs/Schemas/ProgramInfolist.php
Normal file
21
app/Filament/Resources/Programs/Schemas/ProgramInfolist.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Programs\Schemas;
|
||||
|
||||
use Filament\Infolists\Components\TextEntry;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class ProgramInfolist
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
TextEntry::make('group.id'),
|
||||
TextEntry::make('created_at')
|
||||
->dateTime(),
|
||||
TextEntry::make('updated_at')
|
||||
->dateTime(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
47
app/Filament/Resources/Programs/Tables/ProgramsTable.php
Normal file
47
app/Filament/Resources/Programs/Tables/ProgramsTable.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Programs\Tables;
|
||||
|
||||
use Filament\Tables\Actions\BulkActionGroup;
|
||||
use Filament\Tables\Actions\DeleteBulkAction;
|
||||
use Filament\Tables\Actions\EditAction;
|
||||
use Filament\Tables\Actions\ViewAction;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class ProgramsTable
|
||||
{
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('group.name')
|
||||
->label('Topar')
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('days')
|
||||
->label('Gün sany')
|
||||
->getStateUsing(fn ($record) => count($record->days).' gün')
|
||||
->sortable(),
|
||||
TextColumn::make('created_at')
|
||||
->label('Döredilen wagty')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('updated_at')
|
||||
->label('Üýtgedilen wagty')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
])
|
||||
->actions([
|
||||
ViewAction::make(),
|
||||
EditAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
BulkActionGroup::make([
|
||||
DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,6 @@ use App\Models\Room;
|
||||
use BackedEnum;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class RoomResource extends Resource
|
||||
@@ -21,13 +20,14 @@ class RoomResource extends Resource
|
||||
protected static ?string $navigationLabel = 'Otaglar';
|
||||
|
||||
protected static ?string $pluralLabel = 'Otaglar';
|
||||
|
||||
protected static ?string $modelLabel = 'Otag';
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'name';
|
||||
|
||||
protected static ?int $navigationSort = 6;
|
||||
protected static string | BackedEnum | null $navigationIcon = 'icon-door-open';
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = 'icon-door-open';
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
@@ -36,7 +36,8 @@ class RoomResource extends Resource
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return $table->columns(RoomsTable::schema());
|
||||
return $table
|
||||
->columns(RoomsTable::schema());
|
||||
}
|
||||
|
||||
public static function getRelations(): array
|
||||
|
||||
@@ -27,7 +27,7 @@ class RoomForm
|
||||
->required()
|
||||
->numeric()
|
||||
->default(1),
|
||||
|
||||
|
||||
Forms\Components\Checkbox::make('wide')
|
||||
->default(false)
|
||||
->required(),
|
||||
|
||||
@@ -9,17 +9,22 @@ class RoomsTable
|
||||
public static function schema(): array
|
||||
{
|
||||
return [
|
||||
Tables\Columns\TextColumn::make('hotel.name')
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('name')
|
||||
->searchable(),
|
||||
|
||||
Tables\Columns\TextColumn::make('hotel.name')
|
||||
->sortable(),
|
||||
|
||||
Tables\Columns\TextColumn::make('floor')
|
||||
->searchable(),
|
||||
|
||||
Tables\Columns\TextColumn::make('bed_count')
|
||||
->numeric()
|
||||
->sortable(),
|
||||
|
||||
Tables\Columns\IconColumn::make('wide')
|
||||
->boolean(),
|
||||
|
||||
Tables\Columns\TextColumn::make('created_at')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
|
||||
@@ -11,8 +11,8 @@ use Filament\Actions\BulkActionGroup;
|
||||
use Filament\Actions\DeleteBulkAction;
|
||||
use Filament\Actions\EditAction as ActionsEditAction;
|
||||
use Filament\Forms;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Tables;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Contracts\Support\Htmlable;
|
||||
@@ -29,7 +29,7 @@ class TeacherResource extends Resource
|
||||
|
||||
protected static ?int $navigationSort = 3;
|
||||
|
||||
public static function getNavigationIcon(): string | BackedEnum | Htmlable | null
|
||||
public static function getNavigationIcon(): string|BackedEnum|Htmlable|null
|
||||
{
|
||||
return 'heroicon-o-user-group';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user