コード例 #1
0
 public function store(CheckoutRequest $request)
 {
     $data = $request->all();
     $clienteId = $this->userRepository->find(Auth::user()->id)->cliente->id;
     $data['cliente_id'] = $clienteId;
     $this->service->create($data);
     return redirect()->route('consumidor.pedido.index');
 }
コード例 #2
0
 public function store(CheckoutRequest $request)
 {
     $data = $request->all();
     $id = Authorizer::getResourceOwnerId();
     $clienteId = $this->userRepository->find($id)->cliente->id;
     $data['cliente_id'] = $clienteId;
     $object = $this->service->create($data);
     return $this->pedidoRepository->skipPresenter(false)->with($this->with)->find($object->id);
 }
コード例 #3
0
 public function updateStatus(Request $request, $id)
 {
     $idDeliveryman = Authorizer::getResourceOwnerId();
     $order = $this->service->updateStatus($id, $idDeliveryman, $request->get('status'));
     if ($order) {
         return $this->pedidoRepository->find($order->id);
     }
     abort(400, 'Pedido não encontrado');
 }