public function productList()
 {
     $message = \Session::get('message');
     $list = \App\Product::all();
     $dimensions = Arrays::dimensionNames();
     return view('admin.list', compact('list', 'dimensions', 'message'));
 }
 public function product($id)
 {
     $product = \App\Product::find($id);
     $pData = unserialize($product->data);
     $dimensions = \App\Classes\Helpers\Arrays::dimensionNames();
     //$currency = session('currency');
     $currency = 'RUB';
     return view('template.singleProduct', compact('product', 'pData', 'dimensions', 'currency'));
 }
 public function order()
 {
     $cartData = shoppingCart::getCart();
     $cart = unserialize($cartData->data);
     $cartId = $cartData->id;
     $eachAmount = $cart->getAmmounts();
     $products = [];
     $currency = session('currency');
     $curSign = \App\Classes\Helpers\Arrays::currencyLogo($currency);
     $total = 0;
     foreach ($cart->getProducts() as $id) {
         $item = \App\Product::find($id);
         $products[$id] = unserialize($item->data);
         $total += $products[$id]->getPrice($currency) * $eachAmount[$id];
     }
     return view('template.order', compact('products', 'eachAmount', 'currency', 'curSign', 'total', 'cartId'));
 }
Exemple #4
0
							<ul class="dropdown-menu" role="menu">
								<li><a href="{{ url('/auth/logout') }}">Выход</a></li>
							</ul>
						</li>
					@endif
				</ul>
			</div>
		</div>
	</nav>
    <div class="container">
        <div class="row">
            <div class="col-md-2">
                @if(\Auth::check())
                <ul class="nav nav-pills nav-stacked">
                    <?php 
$admRouts = \App\Classes\Helpers\Arrays::adminRouts();
$curRoute = \Route::currentRouteName();
?>
                    @foreach($admRouts as $name => $value)
                        @if($name == $curRoute)
                            <li role="presentation" class="active"><a href="{{route($name)}}">{{$value}}</a></li>
                        @else
                            <li role="presentation"><a href="{{route($name)}}">{{$value}}</a></li>
                        @endif

                    @endforeach

                </ul>
                @endif
            </div>
            <div class="col-md-10">