From ddc5f2664c32b4719f2dc78f7f51cf4e1bf674de Mon Sep 17 00:00:00 2001 From: Ludovic CANDELLIER Date: Mon, 21 Mar 2022 21:52:12 +0100 Subject: [PATCH] Add variations, slider, fix cart ... --- app/Console/Commands/untranslateShelves.php | 50 +++++++++++++ app/Datatables/Shop/CategoriesDataTable.php | 2 +- app/Datatables/Shop/OffersDataTable.php | 10 +-- .../Controllers/Shop/ArticleController.php | 2 + .../Controllers/Shop/BasketController.php | 70 +++++++++++++++++++ app/Http/Controllers/Shop/HomeController.php | 4 +- app/Models/Shop/Category.php | 15 +++- app/Models/Shop/Offer.php | 31 ++++++++ app/Repositories/Core/Categories.php | 5 +- app/Repositories/Core/User/ShopCart.php | 6 +- .../Core/User/ShopCartStorage.php | 6 +- app/Repositories/Shop/Articles.php | 18 ++++- app/Repositories/Shop/Categories.php | 6 ++ app/Repositories/Shop/Offers.php | 35 +++++++++- .../Admin/Shop/Categories/form.blade.php | 6 +- .../partials/ArticleAddBasket.blade.php | 57 +++++++++++++++ .../Articles/partials/addBasket.blade.php | 51 ++++++++++++++ resources/views/Shop/Articles/show.blade.php | 49 ++----------- .../partials/sliderByShelve.blade.php | 31 ++++++++ .../partials/sliderByShelve2.blade.php | 18 +++++ resources/views/Shop/home.blade.php | 12 ++-- resources/views/components/card.blade.php | 2 +- .../views/components/form/button.blade.php | 6 +- resources/views/load/slick.blade.php | 6 +- routes/Shop/Baskets.php | 12 ++++ routes/Shop/Categories.php | 6 +- routes/Shop/route.php | 3 +- 27 files changed, 438 insertions(+), 81 deletions(-) create mode 100644 app/Console/Commands/untranslateShelves.php create mode 100644 app/Http/Controllers/Shop/BasketController.php create mode 100644 resources/views/Shop/Articles/partials/ArticleAddBasket.blade.php create mode 100644 resources/views/Shop/Articles/partials/addBasket.blade.php create mode 100644 resources/views/Shop/Homepage/partials/sliderByShelve.blade.php create mode 100644 resources/views/Shop/Homepage/partials/sliderByShelve2.blade.php create mode 100644 routes/Shop/Baskets.php diff --git a/app/Console/Commands/untranslateShelves.php b/app/Console/Commands/untranslateShelves.php new file mode 100644 index 00000000..9a02bfc7 --- /dev/null +++ b/app/Console/Commands/untranslateShelves.php @@ -0,0 +1,50 @@ +name, true); + $name = $trans['fr']; + $trans = $category->description ? json_decode($category->description, true) : false; + $description = $trans ? $trans['fr'] : ''; + $category->update(['name' => $name, 'description' => $description]); + } + } +} diff --git a/app/Datatables/Shop/CategoriesDataTable.php b/app/Datatables/Shop/CategoriesDataTable.php index dbb7c34e..df985a9a 100644 --- a/app/Datatables/Shop/CategoriesDataTable.php +++ b/app/Datatables/Shop/CategoriesDataTable.php @@ -12,7 +12,7 @@ class CategoriesDataTable extends DataTable public function query(Category $model) { - $model = $model::with(['tags.articles'])->withCount(['articles', 'tags']); + $model = $model::notRoot()->with(['tags.articles'])->withCount(['articles', 'tags']); return $this->buildQuery($model); } diff --git a/app/Datatables/Shop/OffersDataTable.php b/app/Datatables/Shop/OffersDataTable.php index 7c49f64b..ea7f1bcf 100644 --- a/app/Datatables/Shop/OffersDataTable.php +++ b/app/Datatables/Shop/OffersDataTable.php @@ -59,11 +59,11 @@ class OffersDataTable extends DataTable { return [ Column::make('status_id')->title('')->width(40), - Column::make('article.article_nature.name')->title('Nature'), - Column::make('thumb')->title('')->width(40)->searchable(false), - Column::make('article.name')->title('Article'), - Column::make('variation.name')->title('Déclinaison'), - Column::make('tariff.name')->title('Tarif'), + Column::make('article.article_nature.name')->title('Nature')->defaultContent(''), + Column::make('thumb')->title('')->width(40)->searchable(false)->order(false), + Column::make('article.name')->title('Article')->defaultContent(''), + Column::make('variation.name')->title('Déclinaison')->defaultContent(''), + Column::make('tariff.name')->title('Tarif')->defaultContent(''), Column::make('stock_current')->title('Appro im')->searchable(false), Column::make('stock_delayed')->title('Appro délai')->searchable(false), Column::make('stock_ondemand')->title('Dmde')->searchable(false), diff --git a/app/Http/Controllers/Shop/ArticleController.php b/app/Http/Controllers/Shop/ArticleController.php index b7ee3e8b..efa55f72 100644 --- a/app/Http/Controllers/Shop/ArticleController.php +++ b/app/Http/Controllers/Shop/ArticleController.php @@ -14,6 +14,8 @@ class ArticleController extends Controller { $data = self::init(); $data['article'] = Articles::getArticleToSell($id); + // dump($data); + // exit; return view('Shop.Articles.show', $data); } } diff --git a/app/Http/Controllers/Shop/BasketController.php b/app/Http/Controllers/Shop/BasketController.php new file mode 100644 index 00000000..e9169dfc --- /dev/null +++ b/app/Http/Controllers/Shop/BasketController.php @@ -0,0 +1,70 @@ +input('offer_id'); + $quantity = $request->input('quantity'); + $price = Offers::getPrice($offer_id, $quantity)->price_taxed; + return $quantity * $price; + } + + public function addBasket(Request $request) + { + $offer_id = $request->input('offer_id'); + $quantity = $request->input('quantity'); + + if (ShopCart::has($offer_id)) { + $ret = ShopCart::remove($offer_id); + } + $data = Offers::getBasketData($offer_id, $quantity); + $ret = ShopCart::add($data); + return true; + } + + public function basket() + { + $data['basket'] = Offers::getBasket(); + dump($data['basket']->toArray()); + exit; + return view('Shop.Baskets.basket', $data); + } + + public function getBasket() + { + $data = ShopCart::getContent(); + return response()->json(['data' => $data, 'code' => '200']); + } + + public function countBasket() + { + return ShopCart::count(); + } + + public function order(Request $request) + { + ShopCart::clear(); + $data = $request->all(); + unset($data['_token']); + $data['user_id'] = Users::getId(); + Orders::newOrder($data); + return response()->json(['code' => '200']); + + // return redirect()->route('ThirdParty.select'); + } + + public function clearBasket() + { + return ShopCart::clear(); + } +} diff --git a/app/Http/Controllers/Shop/HomeController.php b/app/Http/Controllers/Shop/HomeController.php index e9debb86..1f83f940 100644 --- a/app/Http/Controllers/Shop/HomeController.php +++ b/app/Http/Controllers/Shop/HomeController.php @@ -23,7 +23,9 @@ class HomeController extends Controller $input = $request->input(); $data = self::init(); $data['display_by_rows'] = $input['by_rows'] ?? false; - $data['articles'] = Articles::getArticlesToSell(); + $data['shelves'] = Articles::getArticlesByHomepage(); + // dump($data['shelves']); + // exit; $data['tags'] = TagGroups::getWithTagsAndCountOffers(); return view('Shop.home', $data); } diff --git a/app/Models/Shop/Category.php b/app/Models/Shop/Category.php index 3d6babc4..d877422f 100644 --- a/app/Models/Shop/Category.php +++ b/app/Models/Shop/Category.php @@ -24,12 +24,13 @@ class Category extends parentCategory protected $guarded = ['id']; protected $table = 'categories'; - public $translatable = ['name', 'description']; + public $translatable = []; protected $cascadeDeleteMorph = ['Articles']; protected $fillable = [ + 'visible', + 'homepage', 'slug', 'name', - 'visible', 'description', NestedSet::LFT, NestedSet::RGT, @@ -61,4 +62,14 @@ class Category extends parentCategory { return $query->where('visible', 1); } + + public function scopeHomepage($query) + { + return $query->where('homepage', 1); + } + + public function scopeNotRoot($query) + { + return $query->where('id', '<>', 1); + } } diff --git a/app/Models/Shop/Offer.php b/app/Models/Shop/Offer.php index c5e3eb47..f44fda8a 100644 --- a/app/Models/Shop/Offer.php +++ b/app/Models/Shop/Offer.php @@ -150,4 +150,35 @@ class Offer extends Model $query->active()->bySaleChannel($sale_channel_id); }); } + + public function scopeWithPriceListsBySaleChannel($query, $sale_channel_id) + { + return $query->with([ + 'price_lists' => function($query) use ($sale_channel_id) { + $query->bySaleChannel($sale_channel_id); + } + ]); + } + + public function scopeWithPriceListValuesBySaleChannel($query, $sale_channel_id) + { + return $query->with([ + 'price_lists' => function($query) use ($sale_channel_id) { + $query->bySaleChannel($sale_channel_id); + }, + 'price_lists.price_list_values', + ]); + } + + public function scopeWithPriceBySaleChannelByQuantity($query, $sale_channel_id, $quantity = 1) + { + return $query->with([ + 'price_lists' => function($query) use ($sale_channel_id) { + $query->bySaleChannel($sale_channel_id); + }, + 'price_lists.price_list_values' => function($query) use ($quantity) { + $query->byQuantity($quantity); + }, + ]); + } } diff --git a/app/Repositories/Core/Categories.php b/app/Repositories/Core/Categories.php index dafa5c9c..91ccd930 100644 --- a/app/Repositories/Core/Categories.php +++ b/app/Repositories/Core/Categories.php @@ -20,7 +20,6 @@ class Categories { $categories = self::getCategoryTreeVisibles()->toArray(); return $categories ? self::getChildren($categories[0]['children'], $withFolder) : []; - return $categories ? self::getChildren($categories[0]['children'], $withFolder) : []; } public static function getTree($withFolder = false) @@ -111,7 +110,7 @@ class Categories public static function getModel() { - // return Category::class; - return app('rinvex.categories.category'); + return app(Category::class); + // return app('rinvex.categories.category'); } } diff --git a/app/Repositories/Core/User/ShopCart.php b/app/Repositories/Core/User/ShopCart.php index a8d2cd12..1b3967a9 100644 --- a/app/Repositories/Core/User/ShopCart.php +++ b/app/Repositories/Core/User/ShopCart.php @@ -3,6 +3,7 @@ namespace App\Repositories\Core\User; use App\Repositories\Core\Auth\Users; +use Illuminate\Support\Facades\Auth; use \Cart; class ShopCart @@ -19,9 +20,8 @@ class ShopCart public static function clear() { - Cart::session(1)->clear(); - return Cart::clear(); - // return self::get()->clear(); + Cart::clear(); + return Cart::session(Auth::id())->clear(); } public static function has($id) diff --git a/app/Repositories/Core/User/ShopCartStorage.php b/app/Repositories/Core/User/ShopCartStorage.php index 9075eebd..eff1438d 100644 --- a/app/Repositories/Core/User/ShopCartStorage.php +++ b/app/Repositories/Core/User/ShopCartStorage.php @@ -16,11 +16,11 @@ class ShopCartStorage public function get($key) { - if ($this->has($key)) { - return new CartCollection(CartStorage::find($key)->cart_data); - } else { + if (!$this->has($key)) { return []; } + return new CartCollection(CartStorage::find($key)->cart_data); + } public function put($key, $value) diff --git a/app/Repositories/Shop/Articles.php b/app/Repositories/Shop/Articles.php index c7fd7de9..eb239575 100644 --- a/app/Repositories/Shop/Articles.php +++ b/app/Repositories/Shop/Articles.php @@ -32,7 +32,8 @@ class Articles $article_ids = self::getSiblingsIds($id); $offers = Offers::getOffersByArticles($article_ids, $sale_channel_id); foreach ($offers as $offer) { - $data[strtolower($offer->article_nature->name)] = [ + $data[strtolower($offer->article_nature->name)][] = [ + 'id' => $offer->id, 'name' => $offer->variation->name, 'prices' => $offer->tariff->price_lists->first()->price_list_values->toArray(), ]; @@ -77,7 +78,6 @@ class Articles public static function getArticleToSell($id, $sale_channel_id = false) { - $sale_channel_id = $sale_channel_id ? $sale_channel_id : SaleChannels::getDefaultID(); $article = self::get($id); $data = $article->toArray(); $parents = self::getInheritedByProduct($article->product_id, $article->product_type); @@ -126,6 +126,19 @@ class Articles return $data; } + public static function getArticlesByHomepage() + { + $shelves = Categories::getByHomepage(); + foreach ($shelves as $shelve) { + $data[] = [ + 'id' => $shelve->id, + 'name' => $shelve->name, + 'articles' => self::getArticlesToSell($shelve->id), + ]; + } + return $data; + } + public static function getArticlesToSell($category_id = false, $tags = false) { $articles = self::getArticlesWithOffers($category_id, $tags); @@ -135,6 +148,7 @@ class Articles if (count($price_lists)) { if (!is_array($data[$article->name] ?? false)) { $data[$article->name] = [ + 'id' => $article->id, 'description' => (!empty($article->description)) ? $article->description : $article->product->description, 'image' => self::getFullImageByArticle($article), 'product_type' => $article->product_type, diff --git a/app/Repositories/Shop/Categories.php b/app/Repositories/Shop/Categories.php index a3be9a4b..1dd83867 100644 --- a/app/Repositories/Shop/Categories.php +++ b/app/Repositories/Shop/Categories.php @@ -8,6 +8,12 @@ use App\Repositories\Core\Categories as CategoryTrees; class Categories { + + public static function getByHomepage() + { + return Category::homepage()->orderBy('name', 'asc')->get(); + } + public static function getAll() { return Category::orderBy('name', 'asc')->get(); diff --git a/app/Repositories/Shop/Offers.php b/app/Repositories/Shop/Offers.php index 7543f175..ce44944c 100644 --- a/app/Repositories/Shop/Offers.php +++ b/app/Repositories/Shop/Offers.php @@ -3,9 +3,40 @@ namespace App\Repositories\Shop; use App\Models\Shop\Offer; +use App\Repositories\Core\User\ShopCart; class Offers { + + public static function getPrice($id, $quantity = 1, $sale_channel_id = false) + { + $sale_channel_id = $sale_channel_id ? $sale_channel_id : SaleChannels::getDefaultID(); + $offer = Offer::withPriceBySaleChannelByQuantity($sale_channel_id, $quantity)->find($id); + return $offer->price_lists->first()->price_list_values->first(); + } + + public static function getBasket() + { + $basket = ShopCart::getContent(); + $offers = Offer::with(['variation', 'article.article_nature'])->whereIn('id', ShopCart::keys())->get(); + dump($basket->toArray()); + dump($offers->toArray()); + exit; + return $data; + } + + public static function getBasketData($id, $quantity = 1) + { + $offer = Offer::with(['article'])->findOrFail($id); + return [ + 'id' => $id, + 'name' => $offer->article->name, + 'price' => self::getPrice($id, $quantity)->price_taxed, + 'quantity' => $quantity, + 'attributes' => [], + ]; + } + public static function getOffersByArticles($articles_ids, $sale_channel_id = false) { $sale_channel_id = $sale_channel_id ? $sale_channel_id : SaleChannels::getDefaultID(); @@ -13,7 +44,7 @@ class Offers ->with([ 'article_nature', 'variation', - 'tariff.price_lists' => function($query) use ($sale_channel_id) { + 'tariff.price_lists' => function ($query) use ($sale_channel_id) { $query->bySaleChannel($sale_channel_id); }, 'tariff.price_lists.price_list_values', @@ -30,7 +61,7 @@ class Offers ->with([ 'article_nature', 'variation', - 'tariff.price_lists' => function($query) use ($sale_channel_id) { + 'tariff.price_lists' => function ($query) use ($sale_channel_id) { $query->bySaleChannel($sale_channel_id); }, 'tariff.price_lists.price_list_values', diff --git a/resources/views/Admin/Shop/Categories/form.blade.php b/resources/views/Admin/Shop/Categories/form.blade.php index b033feb3..63a45b84 100644 --- a/resources/views/Admin/Shop/Categories/form.blade.php +++ b/resources/views/Admin/Shop/Categories/form.blade.php @@ -1,7 +1,7 @@
-
+
{{ Form::label('name', 'Nom') }} @include('components.form.input', ['name' => 'name', 'value' => $category['name'] ?? null, 'required' => true])
@@ -16,6 +16,10 @@ 'class' => 'select2', ])
+
+ {{ Form::label('homepage', 'Accueil') }}
+ @include('components.form.toggle', ['name' => 'homepage', 'value' => $category['homepage'] ?? null]) +
{{ Form::label('visible', 'Visible') }}
@include('components.form.toggle', ['name' => 'visible', 'value' => $category['visible'] ?? null]) diff --git a/resources/views/Shop/Articles/partials/ArticleAddBasket.blade.php b/resources/views/Shop/Articles/partials/ArticleAddBasket.blade.php new file mode 100644 index 00000000..d7fc62b1 --- /dev/null +++ b/resources/views/Shop/Articles/partials/ArticleAddBasket.blade.php @@ -0,0 +1,57 @@ +@if ($article['offers']['semences'] ?? false) + @include('Shop.Articles.partials.addBasket', [ + 'data' => $article['offers']['semences'], + 'title' => 'Semence', + 'model' => 'semences', + ]) +@endif + +@if ($article['offers']['plants'] ?? false) + @include('Shop.Articles.partials.addBasket', [ + 'data' => $article['offers']['plants'], + 'title' => 'Plant', + 'model' => 'plants', + ]) +@endif + +@if ($article['offers']['legumes'] ?? false) + @include('Shop.Articles.partials.addBasket', [ + 'data' => $article['offers']['legumes'], + 'title' => 'Légume', + 'model' => 'legumes', + ]) +@endif + +@push('js') + +@endpush diff --git a/resources/views/Shop/Articles/partials/addBasket.blade.php b/resources/views/Shop/Articles/partials/addBasket.blade.php new file mode 100644 index 00000000..bab98c5c --- /dev/null +++ b/resources/views/Shop/Articles/partials/addBasket.blade.php @@ -0,0 +1,51 @@ +@component('components.card', [ + 'id_card' => $model . '-basket', + 'title' => $title, + 'class' => 'mb-3', +]) + + @include('components.form.select', [ + 'name' => 'offer_id', + 'id_name' => $model . '-offer_id', + 'list' => collect($data)->pluck('name', 'id')->toArray(), + 'class' => 'select2 mb-2', + ]) + +
+
+ @include('components.form.inputs.number', [ + 'name' => 'quantity', + 'id_name' => $model . '-quantity', + 'value' => 1, + ]) +
+
+ + {{ $data[0]['prices'][0]['price_taxed'] }} + + € TTC +
+
+ +
+
+ @include('components.form.button', [ + 'metadata' => 'data-type=' . $model, + 'class' => 'btn-success basket w-100 ' . $model, + 'txt' => 'Ajouter au panier', + ]) +
+
+ +@endcomponent + +@push('js') + +@endpush diff --git a/resources/views/Shop/Articles/show.blade.php b/resources/views/Shop/Articles/show.blade.php index e9f9dd0e..96a6c05f 100644 --- a/resources/views/Shop/Articles/show.blade.php +++ b/resources/views/Shop/Articles/show.blade.php @@ -4,56 +4,19 @@ @section('content')
-
+
+

{{ $article['name'] }}

-
+
+
+
{!! $article['image_big'] !!}
-

{{ $article['name'] }}

{!! $article['description'] !!}
- @if ($article['offers']['semences'] ?? false) - @component('components.card', [ - 'title' => 'Semence', - 'class' => 'mb-3', - ]) - {{ $article['offers']['semences']['name'] }}
- {{ $article['offers']['semences']['prices'][0]['price_taxed'] }}
- @include('components.form.button', [ - 'class' => 'btn-success basket semences', - 'txt' => 'Ajouter au panier', - ]) - @endcomponent - @endif - - @if ($article['offers']['plants'] ?? false) - @component('components.card', [ - 'title' => 'Plant', - 'class' => 'mb-3', - ]) - {{ $article['offers']['plants']['name'] }}
- {{ $article['offers']['plants']['prices'][0]['price_taxed'] }}
- @include('components.form.button', [ - 'class' => 'btn-success basket plants', - 'txt' => 'Ajouter au panier', - ]) - @endcomponent - @endif - - @if ($article['offers']['legumes'] ?? false) - @component('components.card', [ - 'title' => 'Légume', - 'class' => 'mb-3', - ]) - @include('components.form.button', [ - 'class' => 'btn-success basket legumes', - 'txt' => 'Ajouter au panier', - ]) - @endcomponent - @endif - + @include('Shop.Articles.partials.ArticleAddBasket')
@endsection diff --git a/resources/views/Shop/Homepage/partials/sliderByShelve.blade.php b/resources/views/Shop/Homepage/partials/sliderByShelve.blade.php new file mode 100644 index 00000000..b8919a0d --- /dev/null +++ b/resources/views/Shop/Homepage/partials/sliderByShelve.blade.php @@ -0,0 +1,31 @@ +
+
+
+

{{ $shelve['name'] }}

+
+ +
+
+ @foreach ($shelve['articles'] as $name => $article) + + @endforeach +
+
+ +@push('js') + +@endpush \ No newline at end of file diff --git a/resources/views/Shop/Homepage/partials/sliderByShelve2.blade.php b/resources/views/Shop/Homepage/partials/sliderByShelve2.blade.php new file mode 100644 index 00000000..d1295214 --- /dev/null +++ b/resources/views/Shop/Homepage/partials/sliderByShelve2.blade.php @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/resources/views/Shop/home.blade.php b/resources/views/Shop/home.blade.php index 6e52a16d..f8d0181f 100644 --- a/resources/views/Shop/home.blade.php +++ b/resources/views/Shop/home.blade.php @@ -6,11 +6,11 @@ @include('Shop.Tags.partials.filter')
- @if ($display_by_rows ?? false) - @include('Shop.layout.partials.category_articles_rows') - @else - @include('Shop.layout.partials.category_articles') - @endif + @foreach ($shelves as $shelve) + @include('Shop.Homepage.partials.sliderByShelve') + @endforeach
-@endsection \ No newline at end of file +@endsection + +@include('load.slick') diff --git a/resources/views/components/card.blade.php b/resources/views/components/card.blade.php index ffee3630..92581f67 100644 --- a/resources/views/components/card.blade.php +++ b/resources/views/components/card.blade.php @@ -1,4 +1,4 @@ -
+
@if($title ?? $header ?? false)
@isset($header) diff --git a/resources/views/components/form/button.blade.php b/resources/views/components/form/button.blade.php index 27d2406f..5a6c61ba 100644 --- a/resources/views/components/form/button.blade.php +++ b/resources/views/components/form/button.blade.php @@ -1,4 +1,8 @@ - \ No newline at end of file diff --git a/resources/views/load/slick.blade.php b/resources/views/load/slick.blade.php index 79c54c4b..9b4bbdca 100644 --- a/resources/views/load/slick.blade.php +++ b/resources/views/load/slick.blade.php @@ -1,10 +1,10 @@ @if(!defined('LOAD_SLICKJS')) @push('css') - - + + @endpush @push('scripts') - + @endpush @php(define('LOAD_SLICKJS', true)) @endif \ No newline at end of file diff --git a/routes/Shop/Baskets.php b/routes/Shop/Baskets.php new file mode 100644 index 00000000..c23398e8 --- /dev/null +++ b/routes/Shop/Baskets.php @@ -0,0 +1,12 @@ +name('Basket.')->group(function () { + Route::post('getPrice', 'BasketController@getPrice')->name('getPrice'); + Route::post('addBasket', 'BasketController@addBasket')->name('addBasket'); + Route::get('getBasket', 'BasketController@getBasket')->name('getBasket'); + Route::get('countBasket', 'BasketController@countBasket')->name('countBasket'); + Route::get('clearBasket', 'BasketController@clearBasket')->name('clearBasket'); + Route::get('basket', 'BasketController@basket')->name('basket'); + Route::post('order', 'BasketController@order')->name('order'); +}); + diff --git a/routes/Shop/Categories.php b/routes/Shop/Categories.php index c8aac318..35afd77a 100644 --- a/routes/Shop/Categories.php +++ b/routes/Shop/Categories.php @@ -1,8 +1,8 @@ name('Categories.')->group(function () { - Route::get('', 'CategoryController@index')->name('index'); - Route::get('show/{id}', 'CategoryController@show')->name('show'); - Route::get('getTree', 'CategoryController@getTree')->name('getTree'); + Route::get('', 'CategoryController@index')->name('index'); + Route::get('show/{id}', 'CategoryController@show')->name('show'); + Route::get('getTree', 'CategoryController@getTree')->name('getTree'); }); diff --git a/routes/Shop/route.php b/routes/Shop/route.php index 77ce352b..814c8f30 100644 --- a/routes/Shop/route.php +++ b/routes/Shop/route.php @@ -2,9 +2,10 @@ Route::prefix('Shop')->namespace('Shop')->name('Shop.')->group(function () { include( __DIR__ . '/Articles.php'); + include( __DIR__ . '/Baskets.php'); include( __DIR__ . '/Categories.php'); include( __DIR__ . '/Customers.php'); include( __DIR__ . '/Invoices.php'); - include( __DIR__ . '/Offers.php'); + include( __DIR__ . '/Offers.php'); include( __DIR__ . '/Orders.php'); });