Azade
Azade
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.
After testing a lot of ways, Now this is the answer:
....
Wizard\Step::make('First Step')
->schema([
TextInput::make('title')->required(),
Hidden::make('price'),
Forms\Components\Actions::make([
Action::make('Custom Modal')
->button()
->form([
TextInput::make('price')->prefix('$')->required()
->default(
function (MyModel $record = null) {
return $record?->price;
}
),
])
->action(function (Set $set, array $data) {
$set('price', $data['price']);
}),
]),

]),
....
....
Wizard\Step::make('First Step')
->schema([
TextInput::make('title')->required(),
Hidden::make('price'),
Forms\Components\Actions::make([
Action::make('Custom Modal')
->button()
->form([
TextInput::make('price')->prefix('$')->required()
->default(
function (MyModel $record = null) {
return $record?->price;
}
),
])
->action(function (Set $set, array $data) {
$set('price', $data['price']);
}),
]),

]),
....
4 replies
FFilament
Created by Azade on 12/24/2023 in #❓┊help
input in modal doesn't work
After testing a lot of ways, Now this is the answer:
....
Wizard\Step::make('First Step')
->schema([
TextInput::make('title')->required(),
Hidden::make('price'),
Forms\Components\Actions::make([
Action::make('Custom Modal')
->button()
->form([
TextInput::make('price')->prefix('$')->required()
->default(
function (MyModel $record = null) {
return $record?->price;
}
),
])
->action(function (Set $set, array $data) {
$set('price', $data['price']);
}),
]),

]),
....
....
Wizard\Step::make('First Step')
->schema([
TextInput::make('title')->required(),
Hidden::make('price'),
Forms\Components\Actions::make([
Action::make('Custom Modal')
->button()
->form([
TextInput::make('price')->prefix('$')->required()
->default(
function (MyModel $record = null) {
return $record?->price;
}
),
])
->action(function (Set $set, array $data) {
$set('price', $data['price']);
}),
]),

]),
....
7 replies
FFilament
Created by Azade on 12/24/2023 in #❓┊help
input in modal doesn't work
@Andrew WalloThank you, but it still doesn't work, And also I wanted to say that in modal there were a big form, but I summarized it to ask my question.
7 replies