PHP code example of ycgambo / laravel-vue-templates
1. Go to this page and download the library: Download ycgambo/laravel-vue-templates library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ycgambo / laravel-vue-templates example snippets
public function map()
{
$this->mapApiRoutes();
$this->mapWebRoutes();
$this->mapAdminRoutes();
}
protected function mapAdminRoutes()
{
Route::prefix('admin')
// ->middleware('admin')
->namespace("{$this->namespace}\Admin")
->group(base_path('routes/admin.php'));
\Yb\LVT\Themes\VueAdmin\VueAdmin::create('admin', 'admin')
->inject('admin.base')
->with('menus', $this->getAdminMenus())
->paginate()
->boot();
}
protected function getAdminMenus()
{
$sort = [
'index',
'consumerMessage.manual',
];
$icons = [
'index' => 'fa-tachometer',
'consumerMessage' => 'fa-commenting-o',
];
$names = [
'consumerMessage' => '客服消息',
'consumerMessage.manual' => '手动发送',
'consumerMessage.reply' => '消息回复',
];
$ignores = [
'base',
'consumerMessage.manual_edit',
'consumerMessage.reply_edit',
];
return \Yb\LVT\Menu::in(resource_path('views/admin'))
->prefix('/admin')
->icons($icons)
->names($names)
->ignores($ignores)
->get($sort);
}
resources/views/admin
├── base.blade.php
├── consumerMessage
│ ├── manual.blade.php
│ ├── manual_edit.blade.php
│ ├── reply.blade.php
│ ├── reply_edit.blade.php
└── index.blade.php