/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { return PerformanceHistory::with('member', 'position')->with(['activity' => function ($query) { $query->with('user'); }])->with(['report' => function ($query) { $query->withTrashed(); }])->with(['performance' => function ($query) { $query->withTrashed()->with(['member' => function ($query) { $query->with('experiences'); }])->with('position'); }])->with(['project' => function ($query) { $query->with(['positions' => function ($query) { $query->with(['targets' => function ($query) { $query->withTrashed()->orderBy('created_at', 'desc'); }]); }]); }])->where('activity_id', $id)->get(); }