Beispiel #1
0
 public function detail($slug)
 {
     $product = Product::getDetail($slug);
     // $product = Product::with('variants')->where('slug', $slug)->first();
     // $product->url = route('product', $product->slug);
     // Burası, model içinde olmalı
     //
     list($brand, $collection) = explode('-', strtolower($product->collection), 2);
     $product->{$brand} = TRUE;
     $product->{$collection} = TRUE;
     $view = hbs('content/product-detail', $product->toArray());
     return $this->layout($view);
 }