Arif Hossain
Arif Hossain
FFilament
Created by ismaeltj9 on 10/24/2023 in #❓┊help
Bulk action to Get Selected Material and Create New Order With These Materials
1. pass the records ids as coma separated in redirect $data['item_ids'] = $records ->pluck('id') ->implode(','); return redirect()->route('filament.app.resources.orders.create', $data); 2. in the CreateOrder resource page, overwrite method fillForm as like below protected function fillForm(): void { $itemIds = collect (request('item_ids'))->explode(',')->toArray(); // for filling repeater field 'items' $data['items'] = collect(request('item_ids')) ->explode(',') ->map( function ($itemId) { $item = ''; // format/load/prepare item with itemId return [ "material_id" => $item->material_id, "qty" => $item->qnt, "unit_price" => $item->unit_price ]; } )->toArray() $this->callHook('beforeFill'); $this->form->fill($data); $this->callHook('afterFill'); }
5 replies
FFilament
Created by Arif Hossain on 9/18/2023 in #❓┊help
How can i add select option dynamically from suffixAction ?
create form is creating a option of a relationship select. but I'm trying to pick an option and my select field has no relationship.
6 replies
FFilament
Created by Arif Hossain on 9/18/2023 in #❓┊help
How can i add select option dynamically from suffixAction ?
thanks. $set('union_id', $union->id) is working but new union is not adding to option that is my problem.
6 replies