[Solved] How do I loop a nested array in laravel to get an array based on conditions of key values from that array
[ad_1] Suppose if your $request->option contain array then $filtered = collect($request->option)->whereNotNull(‘option’)->all()->toArray(); Ref: https://laravel.com/docs/8.x/collections#method-wherenotnull [ad_2] solved How do I loop a nested array in laravel to get an array based on conditions of key values from that array