dimanche 1 septembre 2019

Invalid argument supplied for foreach() To-do app

i have a function that displays tasks of current user

public function test(Request $request)
{
    $user= auth()->user();

    return view('welcome')->with('tasks',$user->tasks);
}

This is the code that displays the posts in home view

@foreach($tasks as $task)
    <tr>
        <td class="table-text">
            <div></div>
        </td>
    </tr>
@endforeach

Am getting the error above



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

Aucun commentaire:

Enregistrer un commentaire