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



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire