Azade
Azade
FFilament
Created by Azade on 12/31/2023 in #❓┊help
when I upload a .txt file in filament it changes to .csv !!!
FileUpload::make('file')->nullable()->disk('public')->directory(Notice::Dir)->rule('file')->columnSpan(2),
FileUpload::make('file')->nullable()->disk('public')->directory(Notice::Dir)->rule('file')->columnSpan(2),
I uploaded a .txt file but in directory now I have a .csv file!!!
3 replies
FFilament
Created by Azade on 12/25/2023 in #❓┊help
How to use the value of a field in a form in another modal in filament.
How to use the value of a field in a form in another modal in filament. (The modal that I mentioned is in form) For example in this code I'm gonna set price1. but the value of $get('price') is null in the modal!
->schema([
TextInput::make('price'),
Forms\Components\Actions::make([
Action::make('Custom Modal')
->button()
->form([
TextInput::make('price1')->prefix('$')->required()
->default(
function (Set $set, Get $get) {
$set('price1', $get('price'));
return $get('price');
}
),
])
->action(function (Set $set, Get $get, array $data) {
$set('price', $data['price1']);
}),
]),
->schema([
TextInput::make('price'),
Forms\Components\Actions::make([
Action::make('Custom Modal')
->button()
->form([
TextInput::make('price1')->prefix('$')->required()
->default(
function (Set $set, Get $get) {
$set('price1', $get('price'));
return $get('price');
}
),
])
->action(function (Set $set, Get $get, array $data) {
$set('price', $data['price1']);
}),
]),
4 replies
FFilament
Created by Azade on 12/24/2023 in #❓┊help
input in modal doesn't work
I defined a modal in my form, but I doesn't work, I mean when I submit the main form the create-query doesn't include the input that I put in the modal,
public static function form(Form $form): Form
{
return $form
->schema([
Wizard::make([
Wizard\Step::make('First Step')
->schema([
TextInput::make('title')->required(),
Forms\Components\Actions::make([
Action::make('Custom Modal')
->button()
// ->icon('heroicon-m-price')
->form([
TextInput::make('price')->prefix('€')->required(),
])
->action(function (Set $set, Get $get) {
$set('price', $get('price'));
}),
]),
]),
//...
]),
]);
}
public static function form(Form $form): Form
{
return $form
->schema([
Wizard::make([
Wizard\Step::make('First Step')
->schema([
TextInput::make('title')->required(),
Forms\Components\Actions::make([
Action::make('Custom Modal')
->button()
// ->icon('heroicon-m-price')
->form([
TextInput::make('price')->prefix('€')->required(),
])
->action(function (Set $set, Get $get) {
$set('price', $get('price'));
}),
]),
]),
//...
]),
]);
}
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'price' cannot be null.
7 replies