コード例 #1
0
 public function show($id)
 {
     try {
         $talk = OAuthGuard::user()->talks()->findOrFail($id);
     } catch (Exception $e) {
         App::abort(404);
     }
     $talk = new Talk($talk);
     return response()->jsonApi(['data' => $talk->toArray()]);
 }
コード例 #2
0
 public function show($id)
 {
     try {
         $bio = OAuthGuard::user()->bios()->findOrFail($id);
     } catch (Exception $e) {
         App::abort(404);
     }
     $bio = new Bio($bio);
     return response()->jsonApi(['data' => $bio->toArray()]);
 }
コード例 #3
0
 /**
  * Display all of the given user's bios
  *
  * @return Response
  */
 public function index($userId)
 {
     if ($userId != OAuthGuard::user()->id) {
         App::abort(404);
     }
     $return = OAuthGuard::user()->bios->map(function ($bio) {
         return new Bio($bio);
     });
     return response()->jsonApi(['data' => $return]);
 }
コード例 #4
0
ファイル: MeController.php プロジェクト: jwalton512/symposium
 public function index()
 {
     $me = new Me(OAuthGuard::user());
     return response()->jsonApi(['data' => $me->toArray()]);
 }