Filament v5: Forms\Components\Section → Schemas\Components\Section, Forms\Get → Schemas\Components\Utilities\Get
Layout components (Section, Grid, Tabs, etc.) au fost mutate din Filament\Forms\Components în Filament\Schemas\Components. Forms\Components păstrează doar field-urile (TextInput, Select, etc.). Forms\Get s-a mutat în Schemas\Components\Utilities\Get.
This commit is contained in:
@@ -12,6 +12,7 @@ use Filament\Forms;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Actions;
|
||||
use Filament\Schemas;
|
||||
use Filament\Tables;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
@@ -34,7 +35,7 @@ class AppointmentResource extends Resource
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return $schema->components([
|
||||
Forms\Components\Section::make('Când & unde')
|
||||
Schemas\Components\Section::make('Când & unde')
|
||||
->columns(3)
|
||||
->schema([
|
||||
Forms\Components\DatePicker::make('date')->label('Data')->default(today())->required(),
|
||||
@@ -53,7 +54,7 @@ class AppointmentResource extends Resource
|
||||
->default('scheduled')
|
||||
->required(),
|
||||
]),
|
||||
Forms\Components\Section::make('Client & Auto')
|
||||
Schemas\Components\Section::make('Client & Auto')
|
||||
->columns(2)
|
||||
->schema([
|
||||
Forms\Components\Select::make('client_id')
|
||||
@@ -63,7 +64,7 @@ class AppointmentResource extends Resource
|
||||
->live(),
|
||||
Forms\Components\Select::make('vehicle_id')
|
||||
->label('Auto')
|
||||
->options(fn (Forms\Get $get) => $get('client_id')
|
||||
->options(fn (Schemas\Components\Utilities\Get $get) => $get('client_id')
|
||||
? Vehicle::where('client_id', $get('client_id'))->pluck('plate', 'id')
|
||||
: [])
|
||||
->searchable(),
|
||||
|
||||
Reference in New Issue
Block a user