laravel blade foreach fetching related tasks to projects 'Trying to get property of non-object'
问题 Hi I am trying to output all the related tasks to a Project but I am getting 'Trying to get property of non-object' in my error log so I'm not sure what I am doing wrong, does anyone have any ideas? This is my view which has the foreach {{ $project->project_name }} {{ $project->project_brief }} {{ $project->clients->client_name }} @foreach ($project->tasks as $project) {{ $project->tasks->task_name }} @endforeach This is my repository which performs the query public function getProjectTasks(