You've already forked Atomcms-edit
95 lines
2.5 KiB
PHP
Executable File
95 lines
2.5 KiB
PHP
Executable File
<?php
|
|
|
|
namespace App\Filament\Resources\Hotel\EmulatorTexts;
|
|
|
|
use App\Filament\Resources\Hotel\EmulatorTexts\Pages\ManageEmulatorTexts;
|
|
use App\Filament\Traits\TranslatableResource;
|
|
use App\Models\EmulatorText;
|
|
use Filament\Actions\BulkActionGroup;
|
|
use Filament\Actions\DeleteBulkAction;
|
|
use Filament\Actions\EditAction;
|
|
use Filament\Forms\Components\TextInput;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Schemas\Schema;
|
|
use Filament\Tables\Columns\TextColumn;
|
|
use Filament\Tables\Table;
|
|
|
|
class EmulatorTextResource extends Resource
|
|
{
|
|
use TranslatableResource;
|
|
|
|
#[\Override]
|
|
protected static ?string $model = EmulatorText::class;
|
|
|
|
#[\Override]
|
|
protected static string|\BackedEnum|null $navigationIcon = 'heroicon-o-clipboard-document-list';
|
|
|
|
#[\Override]
|
|
protected static string|\UnitEnum|null $navigationGroup = 'Hotel';
|
|
|
|
#[\Override]
|
|
protected static ?string $slug = 'hotel/emulator-texts';
|
|
|
|
public static string $translateIdentifier = 'emulator-texts';
|
|
|
|
#[\Override]
|
|
public static function form(Schema $schema): Schema
|
|
{
|
|
return $schema
|
|
->components([
|
|
TextInput::make('key')
|
|
->label(__('filament::resources.inputs.key'))
|
|
->required()
|
|
->maxLength(100)
|
|
->unique(ignoreRecord: true),
|
|
|
|
TextInput::make('value')
|
|
->label(__('filament::resources.inputs.value'))
|
|
->required()
|
|
->maxLength(512),
|
|
]);
|
|
}
|
|
|
|
#[\Override]
|
|
public static function table(Table $table): Table
|
|
{
|
|
return $table
|
|
->columns([
|
|
TextColumn::make('key')
|
|
->label(__('filament::resources.columns.key'))
|
|
->searchable(),
|
|
|
|
TextColumn::make('value')
|
|
->label(__('filament::resources.columns.value'))
|
|
->searchable(),
|
|
])
|
|
->filters([
|
|
//
|
|
])
|
|
->recordActions([
|
|
EditAction::make(),
|
|
])
|
|
->toolbarActions([
|
|
BulkActionGroup::make([
|
|
DeleteBulkAction::make(),
|
|
]),
|
|
]);
|
|
}
|
|
|
|
#[\Override]
|
|
public static function getRelations(): array
|
|
{
|
|
return [
|
|
//
|
|
];
|
|
}
|
|
|
|
#[\Override]
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => ManageEmulatorTexts::route('/'),
|
|
];
|
|
}
|
|
}
|