Пример #1
0
 public function store(CheckoutRequest $request)
 {
     $data = $request->all();
     $clientId = $this->userRepository->skipPresenter()->find(Auth::user()->id)->client->id;
     $data['client_id'] = $clientId;
     $this->service->create($data);
     return redirect()->route('customer.order.index');
 }
Пример #2
0
 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next, $role)
 {
     $id = Authorizer::getResourceOwnerId();
     $user = $this->userRepository->skipPresenter(true)->find($id);
     if ($user->role != $role) {
         abort(403, 'Access Forbidden');
     }
     return $next($request);
 }
 public function store(Requests\CheckoutRequest $request)
 {
     $data = $request->all();
     $id = Authorizer::getResourceOwnerId();
     $clientId = $this->userRepository->skipPresenter(true)->find($id)->client->id;
     $data['client_id'] = $clientId;
     $o = $this->service->create($data);
     return $this->orderRepository->skipPresenter(false)->with($this->with)->find($o->id);
 }
 public function authenticated()
 {
     $id = Authorizer::getResourceOwnerId();
     return $this->userRepository->skipPresenter(false)->find($id);
 }
 public function index()
 {
     $id = Authorizer::getResourceOwnerId();
     $logged = $this->userRepository->skipPresenter(false)->find($id);
     return $logged;
 }