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
@@ -8,6 +8,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;
@@ -28,7 +29,7 @@ class ClientResource extends Resource
public static function form(Schema $schema): Schema
{
return $schema->components([
Forms\Components\Section::make('Date generale')
Schemas\Components\Section::make('Date generale')
->columns(2)
->schema([
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('company_name')
->label('Denumire companie')
->visible(fn (Forms\Get $get) => $get('type') === 'company')
->visible(fn (Schemas\Components\Utilities\Get $get) => $get('type') === 'company')
->maxLength(160),
Forms\Components\Select::make('status')
->options([
@@ -50,7 +51,7 @@ class ClientResource extends Resource
->default('active')
->required(),
]),
Forms\Components\Section::make('Contacte')
Schemas\Components\Section::make('Contacte')
->columns(2)
->schema([
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('viber')->maxLength(60),
]),
Forms\Components\Section::make('Marketing')
Schemas\Components\Section::make('Marketing')
->columns(2)
->schema([
Forms\Components\TextInput::make('source')->label('Sursă')->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)
->schema([
Forms\Components\TextInput::make('balance')->label('Sold')->numeric()->default(0),