[Vuejs]-Error of "Invalid argument supplied for foreach()" in Laravel

-1👍

I do not fully understand your code, but I’ve noticed some potentially problematic parts:

  1. $request->form_cashoutexpenses most likely is not an array, that is why you probably getting this error. You can check it putting dd($comments, gettype($comments)); after declaration of $comments and rerunning page
  2. Having return statement inside foreach loop at the first line seems to be silly, because the code below will never be executed.

Leave a comment