當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Category::find方法代碼示例

本文整理匯總了PHP中CodeCommerce\Category::find方法的典型用法代碼示例。如果您正苦於以下問題:PHP Category::find方法的具體用法?PHP Category::find怎麽用?PHP Category::find使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CodeCommerce\Category的用法示例。


在下文中一共展示了Category::find方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: category

 public function category($id)
 {
     $categories = $this->category->all();
     $category = $this->category->find($id);
     $products = $this->product->ofCategory($id)->get();
     return view('store.category', compact('categories', 'category', 'products'));
 }
開發者ID:rvieceli,項目名稱:codecommerce,代碼行數:7,代碼來源:StoreController.php

示例2: category

 public function category($id)
 {
     $categories = Category::all();
     $category = Category::find($id);
     $products = Product::ofCategory($id)->get();
     return view('store.category', compact('categories', 'category', 'products'));
 }
開發者ID:GabrielApG,項目名稱:CodeCommerce,代碼行數:7,代碼來源:StoreController.php

示例3: categoryScope

 public function categoryScope($id, Category $cat, Product $prod)
 {
     $categories = $cat->all();
     $category = $cat->find($id);
     $products = $prod->ofCategory($id)->get();
     return view('store.category', compact('categories', 'products', 'category'));
 }
開發者ID:hugovallada,項目名稱:CodeCommerce,代碼行數:7,代碼來源:StoreController.php

示例4: tag

 public function tag($id)
 {
     $categories = Category::all();
     $tag = Category::find($id);
     $products = Product::ofTag($id)->get();
     $name = 'Tag: ' . $tag->name;
     return view('store.category', compact('categories', 'products', 'name'));
 }
開發者ID:mborgesmartins,項目名稱:lcodecommerce,代碼行數:8,代碼來源:StoreController.php

示例5: category

 public function category($id)
 {
     $category = Category::find($id);
     if ($category) {
         $categories = Category::all();
         $categorie_name = $category->name;
         $products = Category::find($id)->products;
     } else {
         return redirect()->route('store.index');
     }
     return view('store.products', compact('categories', 'categorie_name', 'products'));
 }
開發者ID:arliton,項目名稱:CodeCommerce,代碼行數:12,代碼來源:StoreController.php

示例6: listProductsCategory

 public function listProductsCategory($id)
 {
     $categories = $this->category->all();
     $category = $this->category->find($id);
     return view('store.products_categorie', compact('category', 'categories'));
 }
開發者ID:pvcnogueira,項目名稱:CodeCommerce,代碼行數:6,代碼來源:StoreController.php

示例7: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $this->category->find($id)->delete();
     return redirect()->route('categories.index');
 }
開發者ID:pvcnogueira,項目名稱:CodeCommerce,代碼行數:11,代碼來源:AdminCategoriesController.php

示例8: category

 public function category($id)
 {
     $category = Category::find($id);
     $categories = Category::all();
     return view('store.categories', compact('categories', 'category'));
 }
開發者ID:alansslva,項目名稱:codecommerce,代碼行數:6,代碼來源:StoreController.php

示例9: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $cateogy = $this->category->find($id);
     return $cateogy->name;
 }
開發者ID:LucasFCastro,項目名稱:codecommerce,代碼行數:11,代碼來源:AdminCategoriesController.php

示例10: listByCategory

 public function listByCategory($id)
 {
     $category = Category::find($id);
     return view('store.category', compact('category'));
 }
開發者ID:kzoty,項目名稱:laravel_commerce,代碼行數:5,代碼來源:StoreController.php


注:本文中的CodeCommerce\Category::find方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。