<?php

use App\Distributor\Controllers\SiteMenuController;
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('base-product/parameter', 'DistProductController@parameter');
    $router->resource('dist-product', 'DistProductController');
    //分类
    $router->resource('product-category', 'DistProductCategoryController');
    //参数
    //$router->resource('product-parameter', 'DistProductParameterController');
    //视频分类
    $router->resource('video-category', 'DistVideoCategoryController');
    //视频管理
    $router->resource('dist-video', 'DistVideoController');
    //产品导入
    $router->get('import-product', 'importProductController@index');
    $router->get('import-product/{id}', 'importProductController@show');
    //询价管理
    $router->get('dist-inquiry', 'DistInquiryController@index');
    $router->get('dist-inquiry/{id}','DistInquiryController@show');
    //配置
    $router->get('dist-settings', 'SettingsController@index');
    $router->post('dist-settings', 'SettingsController@store');
    //外观选择
    $router->get('dist-appearance', 'DistAppearanceController@index');
    //菜单管理
    $router->get('site-menu', 'SiteMenuController@index');//列表
    $router->get('site-menu/create','SiteMenuController@create');//新增
    $router->post('site-menu', 'SiteMenuController@store');//新增保存
    $router->get('site-menu/{id}/edit', 'SiteMenuController@edit');//编辑
    $router->put('site-menu/{id}', 'SiteMenuController@update');//编辑保存
    $router->delete('site-menu/{id}', 'SiteMenuController@destroy');//删除
    //文章管理
    $router->resource('site-pages', 'SitePagesController');
    //API相关
    $router->get('api/products', 'ApiController@products');
    $router->get('api/pages', 'ApiController@pages');
    $router->get('api/tag', 'ApiController@tag');
});





