public function handle($request, Closure $next, $role) { $id = Authorizer::getResourceOwnerID(); $user = $this->userRepository->find($id); if ($user->role != $role) { abort('403', 'Access Forbidden'); } return $next($request); }
public function store(CheckoutRequest $request) { $id = Authorizer::getResourceOwnerID(); $data = $request->all(); $clientId = $this->userRepository->find($id)->client->id; $data['client_id'] = $clientId; $order = $this->orderService->create($data); return $this->repository->with($this->with)->find($order->id); }
public function geo(Request $request, Geo $geo, $id) { $idDeliveryman = Authorizer::getResourceOwnerID(); $order = $this->repository->getByIdAndDeliveryman($id, $idDeliveryman); $geo->lat = $request->get('lat'); $geo->long = $request->get('long'); event(new GetLocationDeliveryman($geo, $order)); return $geo; }
public function authenticated() { return $this->clientService->userRepository->skipPresenter(false)->find(Authorizer::getResourceOwnerID()); }