コード例 #1
0
 /**
  * @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.');
 }
コード例 #2
0
 public function organization()
 {
     $id = (int) \Request::segment(2);
     $data = Organization::with('groups')->with('users')->find($id);
     return view('organizations/organization', compact('data'));
 }
コード例 #3
0
 /**
  * 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'));
 }