mardi 27 mars 2018

Pass eloquent collection to array

  $task = Task::all();
   $sort = $task->sortByDesc('id')->toArray();

  return view('welcome')->with('sort',$sort);

i what to pass Eloquent collection object to array and than sort to iterate through but i get this error: htmlspecialchars() expects parameter 1 to be string, array given I don't know what the error means??



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2GhlylG
via IFTTT

Aucun commentaire:

Enregistrer un commentaire