I have this in my controller
$lista = Lesson::where('id', $id_less)
->with(['user' => function ($q) {
$q->where('users.id', Auth::user()->id);
}])
->get();
output is :
[{"id":2,"id_lessontype":"1","name":"Second lesson","text":"","url1":"","url2":"","created_at":"2015-10-22 03:27:14","updated_at":"2015-10-22 03:27:14","user":[{"status":"Complete","id":2,"name":"licki","email":"[email protected]","created_at":"2015-10-22 12:41:49","updated_at":"2015-10-22 12:41:49","pivot":{"lesson_id":2,"user_id":2,"status_id":1}}]}]
How i can only display status of this array?