public function show($id)
 {
     //        $o = $this->orderRepository->with(['client', 'items', 'cupom'])->find($id);
     //        $o = $this->orderRepository->skipPresenter()->with(['client', 'items', 'cupom'])->find($id);
     /* $o->items->each(function($item){
            $item->product;
        }); */
     return $this->orderRepository->skipPresenter(false)->with($this->with)->find($id);
 }
 public function store(CheckoutRequest $request)
 {
     $data = $request->all();
     $id = Authorizer::getResourceOwnerId();
     $clientId = $this->userRepository->find($id)->client->id;
     $data['client_id'] = $clientId;
     $order = $this->orderService->create($data);
     return $this->orderRepository->skipPresenter(false)->find($order->id);
 }
 public function show($id)
 {
     #$order = $this->repository->with(['items', 'client', 'cupom'])->find($id);
     /*$order->items->each(function($item){
           $item->product;
       });*/
     #comentado devido a utilização do presenter
     #return $order;
     return $this->repository->skipPresenter(false)->with($this->with)->find($id);
 }
 public function show($id)
 {
     /* Sem o Presenter e Transformer
        $o = $this->repository->with(['client','items','cupom'])->find($id);
        $o->items->each(function($item){
            $item->product;
        });
        */
     return $this->repository->skipPresenter(false)->with($this->with)->find($id);
 }
 public function show($id)
 {
     $idDeliveryman = Authorizer::getResourceOwnerId();
     $order = $this->orderRepository->skipPresenter(false)->getByIdAndDeliveryman($id, $idDeliveryman);
     /**
      * para forçar retorno do objeto produto
      */
     //       $order->items->each(function($item){
     //          $item->product;
     //       });
     return $order;
 }
 public function show($id)
 {
     /*
     Método 1
      $order = $this->orderRepository
         ->with(['client','items.product','cupom']) - Método 1
         ->find($id);
     
     Método alternativo de fazer a mesma coisa (exibir os produtos) - Método 2
     $order->items->each(function($item){
        $item->product;
     });
     */
     // Método com presenters
     return $this->orderRepository->skipPresenter(false)->with($this->with)->find($id);
 }
 public function show($id)
 {
     $idDeliveryman = Authorizer::getResourceOwnerId();
     return $this->orderRepository->skipPresenter(false)->getByIdAndDeliveryman($id, $idDeliveryman);
 }
 public function show($orderId)
 {
     return $this->orderRepository->skipPresenter(false)->with($this->with)->find($orderId);
 }
 public function show($order_id)
 {
     $user_id = Authorizer::getResourceOwnerId();
     $order = $this->repository->skipPresenter(false)->getByIdAndDeliveryman($order_id, $user_id);
     return $order;
 }
 public function show($id)
 {
     $idClient = Authorizer::getResourceOwnerId();
     return $this->repository->skipPresenter(false)->getByIdAndClient($id, $idClient);
 }
 public function show($id)
 {
     $order = $this->repository->skipPresenter(false)->with($this->with)->find($id);
     return $order;
 }
 public function show($id)
 {
     $idUser = Authorizer::getResourceOwnerId();
     return $this->orderRepository->skipPresenter(false)->with($this->whith)->find($id);
 }