/
spirzen
/
it-code-examples
Обзор
Документация
Войти
/
spirzen
/
it-code-examples
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
examples/php/php-507-1435-001/main.php
57 строк
2 KB
Spirzen
Code migration pack
09 июн 2026, 01:41
09 июн 2026, 01:41
cebc284
Код
Авторство
О чём код?
<?php namespace App\Filament\Resources; use App\Filament\Resources\TaskResource\Pages; use App\Models\Task; use Filament\Forms; use Filament\Forms\Form; use Filament\Resources\Resource; use Filament\Tables; use Filament\Tables\Table; class TaskResource extends Resource { protected static ?string $model = Task::class; protected static ?string $navigationIcon = 'heroicon-o-clipboard-document-list'; public static function form(Form $form): Form { return $form->schema([ Forms\Components\TextInput::make('title') ->required() ->maxLength(200), Forms\Components\Toggle::make('done'), ]); } public static function table(Table $table): Table { return $table ->columns([ Tables\Columns\TextColumn::make('id')->sortable(), Tables\Columns\TextColumn::make('title')->searchable(), Tables\Columns\IconColumn::make('done')->boolean(), Tables\Columns\TextColumn::make('created_at')->dateTime(), ]) ->actions([ Tables\Actions\EditAction::make(), Tables\Actions\DeleteAction::make(), ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([ Tables\Actions\DeleteBulkAction::make(), ]), ]); } public static function getPages(): array { return [ 'index' => Pages\ListTasks::route('/'), 'create' => Pages\CreateTask::route('/create'), 'edit' => Pages\EditTask::route('/{record}/edit'), ]; } }