예제 #1
0
 /**
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function getAll()
 {
     $users = User::paginate(20);
     return $this->respond(Fractal::collection($users, new UserTransformer())->getArray());
 }
예제 #2
0
 /**
  * @param $user_id
  *
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function getAllUserMessages($user_id)
 {
     $messages = Message::where('from', $user_id)->paginate(20);
     return $this->respond(Fractal::collection($messages, new MessageTransformer())->getArray());
 }