<?php

use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Route;
use Dcat\Admin\Admin;

Admin::routes();

Route::group([
    'prefix'     => config('admin.route.prefix'),
    'namespace'  => config('admin.route.namespace'),
    'middleware' => config('admin.route.middleware'),
], function (Router $router) {

    $router->get('/', 'HomeController@index');
    //
    $router->get('dashboard/view', 'DashBoardController@view');
    // 下载数据
    $router->get('dashboard/download', 'DashBoardController@download');

    // 账号
    $router->resource('account','AccountController');

    // 产品管理
    $router->group(['prefix' => 'product'], function (Router $router){
        // 产品
        $router->resource('list','ProductController');
        // 产品分类
        $router->resource('categories','ProductCategoryController');
        // 规格
        $router->resource('{id}/spec','ProductSpecController');
    });
    // 案例管理
    $router->group(['prefix' => 'cases'], function (Router $router){
        // 展厅
        $router->resource('showroom','ShowroomController');
        // 应用案例
        $router->resource('list','ShowroomCaseController');
    });

    // 爆款管理
    $router->group(['prefix' => 'hot'], function (Router $router){
        // 普通客服
        $router->resource('normal','ProductHotController');
        // VIP/设计师
        $router->resource('vip','ProductHotController');
    });

    // 系统设置
    $router->group(['prefix' => 'system'], function (Router $router){
        // 普通客服
        $router->resource('register/banner','BannerController');
        // VIP/设计师
        $router->resource('register/contact','ContactController');

        // VIP/设计师
        $router->resource('setting/logo','SettingController');
    });
});
