/** * @param $id * @param bool $withRoles * @return mixed * @throws GeneralException */ public function findOrThrowException($id, $withRoles = false) { if ($withRoles) { $organization = Organization::with('roles')->withTrashed()->find($id); } else { $organization = Organization::find($id); } if (!is_null($organization)) { return $organization; } throw new GeneralException('That organization does not exist.'); }
public function organization() { $id = (int) \Request::segment(2); $data = Organization::with('groups')->with('users')->find($id); return view('organizations/organization', compact('data')); }
/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { $organization = Organization::with('tickets')->findOrFail($id); return view('organizations.show', compact('organization')); }