<?php
 namespace Module;
 use LayoutMenuItem;
 use TCMS\Module;
 use Route;
 use LayoutData;
 class AdminUserDefault extends Module {
 protected function initialize() {
 }
 protected function registerRoutes() {
 Route::get('/user', 'UserController', 'index')->name('index');
 Route::get('/user/create', 'UserController', 'create')->name('create');
 Route::post('/user/create', 'UserController', 'postCreate')->name('create');
 Route::get('/user/update/{UserModel:id}', 'UserController', 'update')->name('update');
 Route::post('/user/update/{id}', 'UserController', 'postUpdate')->name('update');
 Route::post('/user/delete/{id}', 'UserController', 'postDelete')->name('delete');
 Route::get('/user-group', 'UserGroupController', 'index')->name('user-group-index');
 Route::get('/user-group/create', 'UserGroupController', 'create')->name('user-group-create');
 Route::post('/user-group/create', 'UserGroupController', 'postCreate')->name('user-group-create');
 Route::get('/user-group/update/{id}', 'UserGroupController', 'update')->name('user-group-update');
 Route::post('/user-group/update/{id}', 'UserGroupController', 'postUpdate')->name('user-group-update');
 Route::post('/user-group/delete/{id}', 'UserGroupController', 'postDelete')->name('user-group-delete');
 }
 public function registerComponent() {
 \Model::add('UserModel');
 \Model::add('UserGroupModel');
 }
 public function boot() {
 LayoutData::addMenuItem("user", route('index'), 'Người dùng', 'primary', function(LayoutMenuItem $menuItem) {
 $menuItem->icon = 'fa fa-user';
 }
);
 LayoutData::addSubMenuItem("user-group", route('user-group-index'), 'Nhóm người dùng', 'user', 'primary', function(LayoutMenuItem $menuItem) {
 $menuItem->icon = 'fa fa-users';
 }
);
 }
 public function middleware(string $routeName, $auth) {
 }
 }
