/** * @return \Symfony\Component\HttpFoundation\Response */ public function getAll() { $users = User::paginate(20); return $this->respond(Fractal::collection($users, new UserTransformer())->getArray()); }
/** * @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()); }