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()]); }
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()]); }
/** * 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]); }
public function index() { $me = new Me(OAuthGuard::user()); return response()->jsonApi(['data' => $me->toArray()]); }