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:
2026-05-06 18:07:10 +00:00
parent d2bfae8b1e
commit 721c57ff97
8 changed files with 32 additions and 25 deletions
@@ -9,6 +9,7 @@ use Filament\Forms;
use Filament\Resources\Resource; use Filament\Resources\Resource;
use Filament\Schemas\Schema; use Filament\Schemas\Schema;
use Filament\Actions; use Filament\Actions;
use Filament\Schemas;
use Filament\Tables; use Filament\Tables;
use Filament\Tables\Table; use Filament\Tables\Table;
@@ -27,7 +28,7 @@ class CompanyResource extends Resource
public static function form(Schema $schema): Schema public static function form(Schema $schema): Schema
{ {
return $schema->components([ return $schema->components([
Forms\Components\Section::make('Identificare') Schemas\Components\Section::make('Identificare')
->columns(2) ->columns(2)
->schema([ ->schema([
Forms\Components\TextInput::make('slug') Forms\Components\TextInput::make('slug')
@@ -41,14 +42,14 @@ class CompanyResource extends Resource
Forms\Components\TextInput::make('display_name')->maxLength(120), Forms\Components\TextInput::make('display_name')->maxLength(120),
Forms\Components\TextInput::make('city')->maxLength(60), Forms\Components\TextInput::make('city')->maxLength(60),
]), ]),
Forms\Components\Section::make('Contact') Schemas\Components\Section::make('Contact')
->columns(2) ->columns(2)
->schema([ ->schema([
Forms\Components\TextInput::make('contact_name')->maxLength(120), Forms\Components\TextInput::make('contact_name')->maxLength(120),
Forms\Components\TextInput::make('phone')->tel()->maxLength(40), Forms\Components\TextInput::make('phone')->tel()->maxLength(40),
Forms\Components\TextInput::make('email')->email()->maxLength(120), Forms\Components\TextInput::make('email')->email()->maxLength(120),
]), ]),
Forms\Components\Section::make('Abonament') Schemas\Components\Section::make('Abonament')
->columns(2) ->columns(2)
->schema([ ->schema([
Forms\Components\Select::make('status') Forms\Components\Select::make('status')
+4 -4
View File
@@ -47,7 +47,7 @@ class Settings extends Page
{ {
return $schema return $schema
->components([ ->components([
Forms\Components\Section::make('Brand & contact') Schemas\Components\Section::make('Brand & contact')
->columns(2) ->columns(2)
->schema([ ->schema([
Forms\Components\TextInput::make('display_name')->label('Denumire afișată')->maxLength(120), Forms\Components\TextInput::make('display_name')->label('Denumire afișată')->maxLength(120),
@@ -55,7 +55,7 @@ class Settings extends Page
Forms\Components\TextInput::make('phone')->label('Telefon')->tel()->maxLength(40), Forms\Components\TextInput::make('phone')->label('Telefon')->tel()->maxLength(40),
Forms\Components\TextInput::make('email')->email()->maxLength(120), Forms\Components\TextInput::make('email')->email()->maxLength(120),
]), ]),
Forms\Components\Section::make('Localizare & monedă') Schemas\Components\Section::make('Localizare & monedă')
->columns(3) ->columns(3)
->schema([ ->schema([
Forms\Components\Select::make('language') Forms\Components\Select::make('language')
@@ -65,12 +65,12 @@ class Settings extends Page
Forms\Components\TextInput::make('currency')->label('Monedă')->maxLength(8)->required(), Forms\Components\TextInput::make('currency')->label('Monedă')->maxLength(8)->required(),
Forms\Components\ColorPicker::make('theme_color')->label('Culoare brand'), Forms\Components\ColorPicker::make('theme_color')->label('Culoare brand'),
]), ]),
Forms\Components\Section::make('Servicii & tarif') Schemas\Components\Section::make('Servicii & tarif')
->columns(2) ->columns(2)
->schema([ ->schema([
Forms\Components\TextInput::make('labor_rate')->label('Tarif normo-oră')->numeric()->required(), Forms\Components\TextInput::make('labor_rate')->label('Tarif normo-oră')->numeric()->required(),
]), ]),
Forms\Components\Section::make('Liste configurabile') Schemas\Components\Section::make('Liste configurabile')
->columns(1) ->columns(1)
->schema([ ->schema([
Forms\Components\Textarea::make('services') Forms\Components\Textarea::make('services')
@@ -12,6 +12,7 @@ use Filament\Forms;
use Filament\Resources\Resource; use Filament\Resources\Resource;
use Filament\Schemas\Schema; use Filament\Schemas\Schema;
use Filament\Actions; use Filament\Actions;
use Filament\Schemas;
use Filament\Tables; use Filament\Tables;
use Filament\Tables\Table; use Filament\Tables\Table;
@@ -34,7 +35,7 @@ class AppointmentResource extends Resource
public static function form(Schema $schema): Schema public static function form(Schema $schema): Schema
{ {
return $schema->components([ return $schema->components([
Forms\Components\Section::make('Când & unde') Schemas\Components\Section::make('Când & unde')
->columns(3) ->columns(3)
->schema([ ->schema([
Forms\Components\DatePicker::make('date')->label('Data')->default(today())->required(), Forms\Components\DatePicker::make('date')->label('Data')->default(today())->required(),
@@ -53,7 +54,7 @@ class AppointmentResource extends Resource
->default('scheduled') ->default('scheduled')
->required(), ->required(),
]), ]),
Forms\Components\Section::make('Client & Auto') Schemas\Components\Section::make('Client & Auto')
->columns(2) ->columns(2)
->schema([ ->schema([
Forms\Components\Select::make('client_id') Forms\Components\Select::make('client_id')
@@ -63,7 +64,7 @@ class AppointmentResource extends Resource
->live(), ->live(),
Forms\Components\Select::make('vehicle_id') Forms\Components\Select::make('vehicle_id')
->label('Auto') ->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') ? Vehicle::where('client_id', $get('client_id'))->pluck('plate', 'id')
: []) : [])
->searchable(), ->searchable(),
@@ -8,6 +8,7 @@ use Filament\Forms;
use Filament\Resources\Resource; use Filament\Resources\Resource;
use Filament\Schemas\Schema; use Filament\Schemas\Schema;
use Filament\Actions; use Filament\Actions;
use Filament\Schemas;
use Filament\Tables; use Filament\Tables;
use Filament\Tables\Table; use Filament\Tables\Table;
@@ -28,7 +29,7 @@ class ClientResource extends Resource
public static function form(Schema $schema): Schema public static function form(Schema $schema): Schema
{ {
return $schema->components([ return $schema->components([
Forms\Components\Section::make('Date generale') Schemas\Components\Section::make('Date generale')
->columns(2) ->columns(2)
->schema([ ->schema([
Forms\Components\Select::make('type') Forms\Components\Select::make('type')
@@ -40,7 +41,7 @@ class ClientResource extends Resource
Forms\Components\TextInput::make('name')->label('Nume')->required()->maxLength(120), Forms\Components\TextInput::make('name')->label('Nume')->required()->maxLength(120),
Forms\Components\TextInput::make('company_name') Forms\Components\TextInput::make('company_name')
->label('Denumire companie') ->label('Denumire companie')
->visible(fn (Forms\Get $get) => $get('type') === 'company') ->visible(fn (Schemas\Components\Utilities\Get $get) => $get('type') === 'company')
->maxLength(160), ->maxLength(160),
Forms\Components\Select::make('status') Forms\Components\Select::make('status')
->options([ ->options([
@@ -50,7 +51,7 @@ class ClientResource extends Resource
->default('active') ->default('active')
->required(), ->required(),
]), ]),
Forms\Components\Section::make('Contacte') Schemas\Components\Section::make('Contacte')
->columns(2) ->columns(2)
->schema([ ->schema([
Forms\Components\TextInput::make('phone')->label('Telefon')->tel()->required()->maxLength(40), Forms\Components\TextInput::make('phone')->label('Telefon')->tel()->required()->maxLength(40),
@@ -60,13 +61,13 @@ class ClientResource extends Resource
Forms\Components\TextInput::make('whatsapp')->maxLength(60), Forms\Components\TextInput::make('whatsapp')->maxLength(60),
Forms\Components\TextInput::make('viber')->maxLength(60), Forms\Components\TextInput::make('viber')->maxLength(60),
]), ]),
Forms\Components\Section::make('Marketing') Schemas\Components\Section::make('Marketing')
->columns(2) ->columns(2)
->schema([ ->schema([
Forms\Components\TextInput::make('source')->label('Sursă')->maxLength(60), Forms\Components\TextInput::make('source')->label('Sursă')->maxLength(60),
Forms\Components\TextInput::make('marketing_channel')->label('Canal marketing')->maxLength(60), Forms\Components\TextInput::make('marketing_channel')->label('Canal marketing')->maxLength(60),
]), ]),
Forms\Components\Section::make('Financiar') Schemas\Components\Section::make('Financiar')
->columns(2) ->columns(2)
->schema([ ->schema([
Forms\Components\TextInput::make('balance')->label('Sold')->numeric()->default(0), Forms\Components\TextInput::make('balance')->label('Sold')->numeric()->default(0),
@@ -12,6 +12,7 @@ use Filament\Forms;
use Filament\Resources\Resource; use Filament\Resources\Resource;
use Filament\Schemas\Schema; use Filament\Schemas\Schema;
use Filament\Actions; use Filament\Actions;
use Filament\Schemas;
use Filament\Tables; use Filament\Tables;
use Filament\Tables\Table; use Filament\Tables\Table;
@@ -34,7 +35,7 @@ class DealResource extends Resource
public static function form(Schema $schema): Schema public static function form(Schema $schema): Schema
{ {
return $schema->components([ return $schema->components([
Forms\Components\Section::make('Detalii') Schemas\Components\Section::make('Detalii')
->columns(2) ->columns(2)
->schema([ ->schema([
Forms\Components\Select::make('client_id') Forms\Components\Select::make('client_id')
@@ -44,7 +45,7 @@ class DealResource extends Resource
->required(), ->required(),
Forms\Components\Select::make('vehicle_id') Forms\Components\Select::make('vehicle_id')
->label('Auto') ->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') ? Vehicle::where('client_id', $get('client_id'))->pluck('plate', 'id')
: []) : [])
->searchable(), ->searchable(),
@@ -10,6 +10,7 @@ use Filament\Notifications\Notification;
use Filament\Resources\Resource; use Filament\Resources\Resource;
use Filament\Schemas\Schema; use Filament\Schemas\Schema;
use Filament\Actions; use Filament\Actions;
use Filament\Schemas;
use Filament\Tables; use Filament\Tables;
use Filament\Tables\Table; use Filament\Tables\Table;
@@ -32,7 +33,7 @@ class LeadResource extends Resource
public static function form(Schema $schema): Schema public static function form(Schema $schema): Schema
{ {
return $schema->components([ return $schema->components([
Forms\Components\Section::make('Contact') Schemas\Components\Section::make('Contact')
->columns(2) ->columns(2)
->schema([ ->schema([
Forms\Components\TextInput::make('name')->label('Nume')->required()->maxLength(120), Forms\Components\TextInput::make('name')->label('Nume')->required()->maxLength(120),
@@ -43,14 +44,14 @@ class LeadResource extends Resource
->default('new') ->default('new')
->required(), ->required(),
]), ]),
Forms\Components\Section::make('Auto') Schemas\Components\Section::make('Auto')
->columns(2) ->columns(2)
->schema([ ->schema([
Forms\Components\TextInput::make('car')->label('Marca')->maxLength(60), Forms\Components\TextInput::make('car')->label('Marca')->maxLength(60),
Forms\Components\TextInput::make('model')->maxLength(60), Forms\Components\TextInput::make('model')->maxLength(60),
]), ]),
Forms\Components\Textarea::make('message')->label('Mesaj client')->columnSpanFull()->rows(3), Forms\Components\Textarea::make('message')->label('Mesaj client')->columnSpanFull()->rows(3),
Forms\Components\Section::make('Sursă & Atribuire') Schemas\Components\Section::make('Sursă & Atribuire')
->columns(2) ->columns(2)
->schema([ ->schema([
Forms\Components\Select::make('source') Forms\Components\Select::make('source')
@@ -63,7 +64,7 @@ class LeadResource extends Resource
->searchable(), ->searchable(),
Forms\Components\TextInput::make('budget')->label('Buget')->numeric(), Forms\Components\TextInput::make('budget')->label('Buget')->numeric(),
]), ]),
Forms\Components\Section::make('Marketing (UTM)') Schemas\Components\Section::make('Marketing (UTM)')
->collapsed() ->collapsed()
->columns(2) ->columns(2)
->schema([ ->schema([
@@ -8,6 +8,7 @@ use Filament\Forms;
use Filament\Resources\Resource; use Filament\Resources\Resource;
use Filament\Schemas\Schema; use Filament\Schemas\Schema;
use Filament\Actions; use Filament\Actions;
use Filament\Schemas;
use Filament\Tables; use Filament\Tables;
use Filament\Tables\Table; use Filament\Tables\Table;
use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Hash;
@@ -37,7 +38,7 @@ class UserResource extends Resource
public static function form(Schema $schema): Schema public static function form(Schema $schema): Schema
{ {
return $schema->components([ return $schema->components([
Forms\Components\Section::make('Identitate') Schemas\Components\Section::make('Identitate')
->columns(2) ->columns(2)
->schema([ ->schema([
Forms\Components\TextInput::make('name')->label('Nume')->required()->maxLength(120), Forms\Components\TextInput::make('name')->label('Nume')->required()->maxLength(120),
@@ -47,7 +48,7 @@ class UserResource extends Resource
->options(['ro' => 'Română', 'ru' => 'Русский', 'en' => 'English']) ->options(['ro' => 'Română', 'ru' => 'Русский', 'en' => 'English'])
->default('ro'), ->default('ro'),
]), ]),
Forms\Components\Section::make('Acces') Schemas\Components\Section::make('Acces')
->columns(2) ->columns(2)
->schema([ ->schema([
Forms\Components\Select::make('role') Forms\Components\Select::make('role')
@@ -9,6 +9,7 @@ use Filament\Forms;
use Filament\Resources\Resource; use Filament\Resources\Resource;
use Filament\Schemas\Schema; use Filament\Schemas\Schema;
use Filament\Actions; use Filament\Actions;
use Filament\Schemas;
use Filament\Tables; use Filament\Tables;
use Filament\Tables\Table; use Filament\Tables\Table;
@@ -29,7 +30,7 @@ class VehicleResource extends Resource
public static function form(Schema $schema): Schema public static function form(Schema $schema): Schema
{ {
return $schema->components([ return $schema->components([
Forms\Components\Section::make('Identificare') Schemas\Components\Section::make('Identificare')
->columns(2) ->columns(2)
->schema([ ->schema([
Forms\Components\Select::make('client_id') Forms\Components\Select::make('client_id')
@@ -43,7 +44,7 @@ class VehicleResource extends Resource
Forms\Components\TextInput::make('year')->numeric()->minValue(1950)->maxValue(2100), Forms\Components\TextInput::make('year')->numeric()->minValue(1950)->maxValue(2100),
Forms\Components\TextInput::make('vin')->maxLength(32), Forms\Components\TextInput::make('vin')->maxLength(32),
]), ]),
Forms\Components\Section::make('Tehnice') Schemas\Components\Section::make('Tehnice')
->columns(2) ->columns(2)
->schema([ ->schema([
Forms\Components\TextInput::make('engine')->maxLength(60), Forms\Components\TextInput::make('engine')->maxLength(60),