diff --git a/app/Menu/Shop.php b/app/Menu/Shop.php index b4d872d0..f880f946 100644 --- a/app/Menu/Shop.php +++ b/app/Menu/Shop.php @@ -21,11 +21,15 @@ class Shop ->activeIfRoute(['Shop.Admin.Articles.*'])->order(2); $menu->addTo('shop', 'Familles d\'articles', [ 'route' => 'Shop.Admin.ArticleFamilies.index', 'permission' => 'backend_access' ]) ->activeIfRoute(['Shop.Admin.ArticleFamilies.*'])->order(3); + $menu->addTo('shop', 'Familles d\'attributs d\'articles', [ 'route' => 'Shop.Admin.ArticleAttributeFamilies.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Shop.Admin.ArticleAttributeFamilies.*'])->order(4); + $menu->addTo('shop', 'Attributs d\'articles', [ 'route' => 'Shop.Admin.ArticleAttributes.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Shop.Admin.ArticleAttributes.*'])->order(5); $menu->addTo('shop', 'Commandes', [ 'route' => 'Shop.Admin.Orders.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Shop.Admin.Orders.*'])->order(4); + ->activeIfRoute(['Shop.Admin.Orders.*'])->order(6); $menu->addTo('shop', 'Factures', [ 'route' => 'Shop.Admin.Invoices.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Shop.Admin.Invoices.*'])->order(5); + ->activeIfRoute(['Shop.Admin.Invoices.*'])->order(7); } } diff --git a/app/Models/Shop/TagGroup.php b/app/Models/Shop/TagGroup.php new file mode 100644 index 00000000..a1b2257b --- /dev/null +++ b/app/Models/Shop/TagGroup.php @@ -0,0 +1,11 @@ +make(true); + } + + public static function getAll() + { + return TagGroup::orderBy('name','asc')->get(); + } + + public static function get($id) + { + return TagGroup::find($id); + } + + public static function store($data) + { + $id = isset($data['id']) ? $data['id'] : false; + $item = $id ? self::update($data) : self::create($data); + return $item->id; + } + + public static function create($data) + { + return TagGroup::create($data); + } + + public static function update($data) + { + return TagGroup::find($id)->update($data); + } + + public static function destroy($id) + { + return TagGroup::destroy($id); + } + +} diff --git a/resources/views/Shop/Admin/ArticleAttributeValues/create.blade.php b/resources/views/Shop/Admin/ArticleAttributeValues/create.blade.php index 53d5e646..95ecc6e6 100644 --- a/resources/views/Shop/Admin/ArticleAttributeValues/create.blade.php +++ b/resources/views/Shop/Admin/ArticleAttributeValues/create.blade.php @@ -1,19 +1,19 @@ @extends('layout.index', [ - 'title' => __('article_families.title'), - 'subtitle' => __('article_families.create.title'), - 'breadcrumb' => [__('article_families.title'), __('article_families.create.title')] + 'title' => __('article_attributes.title'), + 'subtitle' => __('article_attributes.create.title'), + 'breadcrumb' => [__('article_attributes.title'), __('article_attributes.create.title')] ]) @include('boilerplate::load.fileinput') @section('content') - {{ Form::open(['route' => 'Shop.Admin.ArticleFamilies.store', 'id' => 'article-family-form', 'autocomplete' => 'off', 'files' => true]) }} + {{ Form::open(['route' => 'Shop.Admin.ArticleAttributes.store', 'id' => 'article-attribute-form', 'autocomplete' => 'off', 'files' => true]) }}