<?php
 namespace VnChocola\Module\Api;
 use TCMS\Module;
 use Route;
 use LayoutData;
 use Model;
 class CallHistory extends Module {
 protected function initialize() {
 }
 protected function registerRoutes() {
 Route::get('/call-history', 'IndexController', 'get')->name('get');
 Route::get('/call-history/{id}', 'IndexController', 'find')->name('find');
 Route::post('/call-history/create', 'IndexController', 'create')->name('create');
 Route::post('/call-history/update', 'IndexController', 'update')->name('update');
 }
 public function registerComponent() {
 Model::add('CallHistorysModel', \VnChocola\Model\CallHistorysModel::class, true);
 Model::add('StaffsModel', \VnChocola\Model\StaffsModel::class, true);
 Model::add('CustomersModel', \VnChocola\Model\CustomersModel::class, true);
 Model::add('HotCustomersModel', \VnChocola\Model\HotCustomersModel::class, true);
 }
 public function boot() {
 }
 public function middleware(string $routeName, $auth) {
 switch($routeName) {
 case 'get': case 'find': case 'create': case 'update': return true;
 default: return false;
 }
 }
 }
