Eager load user on the incident page not to query twice
This commit is contained in:
@@ -75,7 +75,7 @@ class IncidentController extends Controller
|
||||
*/
|
||||
public function showIncidents()
|
||||
{
|
||||
$incidents = Incident::orderBy('created_at', 'desc')->get();
|
||||
$incidents = Incident::with('user')->orderBy('created_at', 'desc')->get();
|
||||
|
||||
return View::make('dashboard.incidents.index')
|
||||
->withPageTitle(trans('dashboard.incidents.incidents').' - '.trans('dashboard.dashboard'))
|
||||
|
||||
Reference in New Issue
Block a user