From 12aff23e00dcfdb681fe7c8b417d30cbb516c96a Mon Sep 17 00:00:00 2001 From: Ludovic CANDELLIER Date: Thu, 20 Aug 2020 01:12:07 +0200 Subject: [PATCH] Pass new parameters --- app/Exports/Botanic/Families.php | 20 ++++++++++++++++++++ app/Exports/Botanic/Genres.php | 20 ++++++++++++++++++++ app/Exports/Botanic/Species.php | 20 ++++++++++++++++++++ app/Exports/Botanic/Varieties.php | 20 ++++++++++++++++++++ app/Http/Controllers/Shop/HomeController.php | 9 ++++++++- app/Menu/Shop.php | 3 ++- app/Repositories/Shop/Articles.php | 5 +++++ 7 files changed, 95 insertions(+), 2 deletions(-) create mode 100644 app/Exports/Botanic/Families.php create mode 100644 app/Exports/Botanic/Genres.php create mode 100644 app/Exports/Botanic/Species.php create mode 100644 app/Exports/Botanic/Varieties.php diff --git a/app/Exports/Botanic/Families.php b/app/Exports/Botanic/Families.php new file mode 100644 index 00000000..cb0f458d --- /dev/null +++ b/app/Exports/Botanic/Families.php @@ -0,0 +1,20 @@ +toArray(); + dump($data); + exit; + return view('Shop.home', $data); } } diff --git a/app/Menu/Shop.php b/app/Menu/Shop.php index 4ccec09e..63a8c41a 100644 --- a/app/Menu/Shop.php +++ b/app/Menu/Shop.php @@ -28,11 +28,12 @@ class Shop $menu->addTo('shop', 'Tags', [ 'route' => 'Shop.Admin.Tags.index', 'permission' => 'backend_access' ]) ->activeIfRoute(['Shop.Admin.Tags.*'])->order(7); - +/* $menu->addTo('shop', 'Réductions', [ 'route' => 'Shop.Admin.ArticleAttributeValues.index', 'permission' => 'backend_access' ]) ->activeIfRoute(['Shop.Admin.ArticleAttributeValues.*'])->order(8); $menu->addTo('shop', 'Stock', [ 'route' => 'Shop.Admin.ArticleAttributeValues.index', 'permission' => 'backend_access' ]) ->activeIfRoute(['Shop.Admin.ArticleAttributeValues.*'])->order(9); + */ $menu->addTo('shop', 'Prix génériques', [ 'route' => 'Shop.Admin.ArticlePriceGenerics.index', 'permission' => 'backend_access' ]) ->activeIfRoute(['Shop.Admin.ArticlePriceGenerics.*'])->order(10); diff --git a/app/Repositories/Shop/Articles.php b/app/Repositories/Shop/Articles.php index 78529c2a..4a5e4c95 100644 --- a/app/Repositories/Shop/Articles.php +++ b/app/Repositories/Shop/Articles.php @@ -47,6 +47,11 @@ class Articles return $data; } + public static function getByCategory($category_id) + { + return Article::with(['prices.article_attribute.attribute_value'])->get(); + } + public static function getCategoriesByArticle($article) { return $article->categories->pluck('id')->toArray();