__Dementor
__Dementor
FFilament
Created by __Dementor on 6/9/2024 in #❓┊help
Repeater have problem
Hi I have create depot delivery form.
return $form
->schema([
Tabs::make()
->tabs([

Tabs\Tab::make('General')
->schema([

Forms\Components\Select::make('depot_id')
->label(__('depot_deliveries.create.depot'))
->required()
->columnSpanFull()
->relationship('depot', 'name', function ($query) {
return $query->where('active', true);
}),

Forms\Components\TextInput::make('invoice_number')
->label(__('depot_deliveries.create.invoice_number'))
->required()
->columnSpanFull()
->maxLength(255),

Forms\Components\DateTimePicker::make('delivery_date')
->required(),

]),

Tabs\Tab::make('Products')
->schema([

Forms\Components\Repeater::make('products')
->required()
->schema([

Forms\Components\Select::make('product_id')
->label(__('depot_deliveries.create.product_id'))
->relationship('products', 'name')
->required(),

Forms\Components\TextInput::make('quantity')
->label(__('depot_deliveries.create.product_quantity'))
->numeric()
->required(),

Forms\Components\TextInput::make('price')
->label(__('depot_deliveries.create.product_price'))
->numeric()
->required(),

])
->columns(3)
->collapsible(),

]),

])->columnSpanFull(),
]);
return $form
->schema([
Tabs::make()
->tabs([

Tabs\Tab::make('General')
->schema([

Forms\Components\Select::make('depot_id')
->label(__('depot_deliveries.create.depot'))
->required()
->columnSpanFull()
->relationship('depot', 'name', function ($query) {
return $query->where('active', true);
}),

Forms\Components\TextInput::make('invoice_number')
->label(__('depot_deliveries.create.invoice_number'))
->required()
->columnSpanFull()
->maxLength(255),

Forms\Components\DateTimePicker::make('delivery_date')
->required(),

]),

Tabs\Tab::make('Products')
->schema([

Forms\Components\Repeater::make('products')
->required()
->schema([

Forms\Components\Select::make('product_id')
->label(__('depot_deliveries.create.product_id'))
->relationship('products', 'name')
->required(),

Forms\Components\TextInput::make('quantity')
->label(__('depot_deliveries.create.product_quantity'))
->numeric()
->required(),

Forms\Components\TextInput::make('price')
->label(__('depot_deliveries.create.product_price'))
->numeric()
->required(),

])
->columns(3)
->collapsible(),

]),

])->columnSpanFull(),
]);
After I send form I have error (photo). How I can resolve this? Products is a relationship, I have table delivery_products for this products.
28 replies
FFilament
Created by __Dementor on 5/11/2024 in #❓┊help
Grid in widgets
No description
7 replies
FFilament
Created by __Dementor on 3/19/2024 in #❓┊help
Move items in menu
No description
7 replies
FFilament
Created by __Dementor on 2/2/2024 in #❓┊help
How disable normal user create a resource for admins
Hi, How I can disable user with a normal role to create resource for admin role?
2 replies
FFilament
Created by __Dementor on 11/29/2023 in #❓┊help
Filament form in view
Hi! I can use a filament resource form in view? I want make recruitment and I need form in view for quest users.
3 replies