コード例 #1
0
 /**
  * @param Request $request
  *
  * @return View|JsonResponse
  */
 public function index(Request $request)
 {
     if ($request->isJson()) {
         return new JsonResponse(array_reverse($this->telegram->getUpdates()));
     }
     return $this->webUi->view('staff.telegram.index');
 }
コード例 #2
0
 /**
  * Display PHP info output.
  *
  * @return string
  */
 public function getPhpInfo()
 {
     ob_start();
     phpinfo();
     $info = ob_get_contents();
     ob_get_clean();
     return $this->webUi->view('staff.dashboard.info', compact('info'));
 }
コード例 #3
0
 /**
  * Display the "Christmas Cards" landing page.
  *
  * @return \Illuminate\Contracts\View\View
  */
 public function christmasCardsAction()
 {
     return $this->webUi->view('customer.landing.christmas-cards', ['products' => $this->tagResource->where('name', '=', 'Christmas')->with(['products' => function ($query) {
         /* @var Product $query */
         $query->inStock();
         $query->with(['images', 'options', 'options.images', 'options.stockItems']);
     }])->first()->products]);
 }
コード例 #4
0
 /**
  * @param int    $offerId
  * @param string $slug
  *
  * @throws ModelNotFoundException
  *
  * @return View|RedirectResponse
  */
 public function view(int $offerId, string $slug)
 {
     /** @var Offer $offer */
     $offer = Offer::findOrFail($offerId);
     if ($offer->slug() !== $slug) {
         return $this->webUi->redirect('offer.show', [$offerId, $offer->slug()]);
     }
     $products = Product::whereHas('offers', function ($query) use($offer) {
         /* @var Builder $query */
         $query->where('id', '=', $offer->id);
     })->with(Product::standardRelations())->paginate();
     return $this->webUi->view('sales::offer.view', compact('offer', 'products'));
 }
コード例 #5
0
 /**
  * @param int    $id
  * @param string $slug
  *
  * @throws \Illuminate\Database\Eloquent\ModelNotFoundException
  *
  * @return View|RedirectResponse
  */
 public function viewCategory(int $id, string $slug)
 {
     /** @var Category $category */
     $category = $this->category->findOrFail(Category::privateId($id));
     if ($category->slug() !== $slug) {
         return $this->webUi->redirect('categories.view', [$category->id, $category->slug()]);
     }
     $tree = $category->getDescendantsAndSelf()->load(['products' => function ($query) {
         /* @var Product $query */
         $query->with(Product::standardRelations());
     }]);
     return $this->webUi->view('customer.category.view', compact('category', 'tree'));
 }
コード例 #6
0
 /**
  * @param       $name
  * @param array $bindData
  *
  * @return View
  */
 private function buildView($name, array $bindData = []) : View
 {
     return $this->webUi->view("catalogue::staff.products.{$name}", $bindData);
 }
コード例 #7
0
 /**
  * Display a listing of the resource.
  *
  * @throws \InvalidArgumentException
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     return $this->webUi->view('catalogue::staff.categories.index', ['categories' => $this->category->roots()->with(['products', 'children'])->orderBy('depth', 'asc')->orderBy('created_at', 'desc')->paginate()]);
 }
コード例 #8
0
 /**
  * @param SearchRequest $request
  *
  * @return \Illuminate\Contracts\View\View
  */
 public function searchAction(SearchRequest $request)
 {
     return $this->webUi->view('customer.product.search', ['query' => $request->searchQuery(), 'products' => $this->productResource->search($request->searchQuery())->paginate(self::PAGE_SIZE)]);
 }
コード例 #9
0
 /**
  * @return \Illuminate\Contracts\View\View
  */
 public function choosePaymentAction()
 {
     return $this->webUi->view('customer.checkout.choose-payment', ['basket' => $this->checkoutAssistant->basket(), 'progress' => 50, 'stripeNonce' => random_int(0, PHP_INT_MAX)]);
 }
コード例 #10
0
 /**
  * @param int $orderId
  *
  * @throws \Illuminate\Database\Eloquent\ModelNotFoundException
  *
  * @return string
  */
 public function viewAction(int $orderId)
 {
     /** @var Order $order */
     $order = $this->orderResource->with(['orderItems.basketItem.productOption.product', 'address'])->findOrFail($this->optimus->decode($orderId));
     return $this->webUi->view('customer.orders.view', compact('order'));
 }
コード例 #11
0
 /**
  * @param $name
  * @param array $bindData
  *
  * @return View
  */
 private function buildView($name, array $bindData = []) : View
 {
     return $this->webUi->view("sales::staff.orders.{$name}", $bindData);
 }
コード例 #12
0
 /**
  * @return \Illuminate\Contracts\View\View
  */
 public function index()
 {
     $tags = $this->tagRepository->loadAll();
     $newTag = new Tag();
     return $this->webUi->view('catalogue::staff.tags.index', compact('tags', 'newTag'));
 }
コード例 #13
0
 /**
  * @throws \InvalidArgumentException
  *
  * @return \Illuminate\Contracts\View\View
  */
 public function index()
 {
     $images = $this->imageRepository->loadLatest();
     return $this->webUi->view('staff.images.index', compact('images'));
 }
コード例 #14
0
 /**
  * View the shopping basket.
  *
  * @return \Illuminate\Contracts\View\View
  */
 public function viewBasketAction()
 {
     return $this->webUi->view('customer.basket.view');
 }