Level 1
Hello Guy
Try this one
$yourCollectionOfSubArr = $request->only(['sub_array.item_1', 'sub_array.item_2']);
You can access to sub item with a dot
2 likes
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello,
I am trying to filter my $request that is returning sub-arrays as well.
I would like to use something along the lines of:
$request->sub-array->only(['item_1', 'item_2']);
It doesn't seem to be working like that. Is it possible in some other way?
Thank you!
Hello Guy
Try this one
$yourCollectionOfSubArr = $request->only(['sub_array.item_1', 'sub_array.item_2']);
You can access to sub item with a dot
Please or to participate in this conversation.