当前位置: 首页>>代码示例>>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;未经允许,请勿转载。