<?php
 namespace Module;
 use LayoutMenuItem;
 use TCMS\Module;
 use Route;
 use LayoutData;
 use Model;
 use Extension;
 class AdminProductBrandDefault extends Module {
 protected function initialize() {
 }
 protected function registerRoutes() {
 Route::get('/product-brand', 'IndexController', 'index') ->name('index');
 Route::get('/product-brand/create', 'IndexController', 'create') ->name('create');
 Route::post('/product-brand/create', 'IndexController', 'postCreate') ->name('create');
 Route::get('/product-brand/update/{id}', 'IndexController', 'update') ->name('update');
 Route::post('/product-brand/update/{id}', 'IndexController', 'postUpdate') ->name('update');
 Route::post('/product-brand/delete', 'IndexController', 'postDelete') ->name('delete');
 }
 public function registerComponent() {
 Model::add('ProductBrandModel', Model\ProductBrandModel::class);
 Model::add('ProductCateModel', \Model\ProductCateModel::class, null, 'ProductCateV2Model');
 }
 public function boot() {
 LayoutData::addSubMenuItem('product-brand', route('index'), 'Thương hiệu', 'product-cate', 'primary', function(LayoutMenuItem $menuItem) {
 $menuItem->icon = 'fa fa-ticket';
 $menuItem->middleware = function($auth) {
 return $auth->hasRole('admin');
 }
;
 }
);
 }
 public function middleware(string $routeName, $auth) {
 }
 }
