How do I transfer data between pages?
Hello, I want to transfer the Ids of the products I have selected here to the products section in the 2nd picture. Only the parts with the product ID here should come. What I want to ask exactly is that when I add another menu under the 3 points and press there, how can I transfer the information in these selected products to the other page and how exactly can I capture this data on that page? For example, if there are 3 products and 2 of them are selected, 2 of their barcodes should go, I hope I was able to explain.
13 Replies
1) Create a bulk action
2) Either store the ids of your
$records
in session or append them as a query param
3) Redirect to your target page
4) Load your data on the page inside mount()
methodI wonder if I need to proceed in this way, I wasn't exactly sure. Do you have a chance to give an example of how I will send when I select more than one record?
->pluck()
the ids or barcodesI could not do the redirect operation, is this not available in BulckAction?
I haven't tried yet. Where's the redirect? It Laravel related not Filament
I tried it this way but it doesn't work.
You didn't return anything. What if you return that redirect response?
Not sure whether it's possible
Is
return redirect($url);
doing anything? I sent it this way. but I cannot use it in ProductQuery as $this->barcode_number
So is it redirecting now?
yes it redirects but I can't use it 😄
Because it's not a route argument. Use the request helper to get query params
It's probably not gonna be exactly what I want. Sending more than one query will look ridiculous in the url part and I think it will take quite a while to extract. but thank you for everything.
You can still put it in a session. But there are no other ways than "forms" or "query params" to send data between urls