<?php

use App\Models\Permission;
use Illuminate\Database\Seeder;

class PermissionsTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $array = [
            [
                'name'        => '产品管理',
                'slug'        => 'admin.product.index',
                'menus_id'    => 7,
                'description' => '产品管理',
            ],
            [
                'name'        => '添加产品',
                'slug'        => 'admin.product.create',
                'menus_id'    => 7,
                'description' => '添加产品',
            ],
            [
                'name'        => '编辑产品',
                'slug'        => 'admin.product.edit',
                'menus_id'    => 7,
                'description' => '编辑产品',
            ],
            [
                'name'        => '删除产品',
                'slug'        => 'admin.product.destroy',
                'menus_id'    => 7,
                'description' => '删除产品',
            ],
            [
                'name'        => '产品分类管理',
                'slug'        => 'admin.product-cate.index',
                'menus_id'    => 38,
                'description' => '产品分类管理',
            ],
            [
                'name'        => '添加产品分类',
                'slug'        => 'admin.product-cate.create',
                'menus_id'    => 38,
                'description' => '添加产品分类',
            ],
            [
                'name'        => '编辑产品分类',
                'slug'        => 'admin.product-cate.edit',
                'menus_id'    => 38,
                'description' => '编辑产品分类',
            ],
            [
                'name'        => '删除产品分类',
                'slug'        => 'admin.product-cate.destroy',
                'menus_id'    => 38,
                'description' => '删除产品分类',
            ],
            [
                'name'        => '自定义页面管理',
                'slug'        => 'admin.page.index',
                'menus_id'    => 36,
                'description' => '自定义页面管理',
            ],
            [
                'name'        => '添加自定义页面',
                'slug'        => 'admin.page.create',
                'menus_id'    => 36,
                'description' => '添加自定义页面',
            ],
            [
                'name'        => '编辑自定义页面',
                'slug'        => 'admin.page.edit',
                'menus_id'    => 36,
                'description' => '编辑自定义页面',
            ],
            [
                'name'        => '删除自定义页面',
                'slug'        => 'admin.page.destroy',
                'menus_id'    => 36,
                'description' => '删除自定义页面',
            ],
            [
                'name'        => '自定义页面分类管理',
                'slug'        => 'admin.page-cate.index',
                'menus_id'    => 44,
                'description' => '自定义页面分类管理',
            ],
            [
                'name'        => '添加自定义页面分类',
                'slug'        => 'admin.page-cate.create',
                'menus_id'    => 44,
                'description' => '添加自定义页面分类',
            ],
            [
                'name'        => '编辑自定义页面分类',
                'slug'        => 'admin.page-cate.edit',
                'menus_id'    => 44,
                'description' => '编辑自定义页面分类',
            ],
            [
                'name'        => '删除自定义页面分类',
                'slug'        => 'admin.page-cate.destroy',
                'menus_id'    => 44,
                'description' => '删除自定义页面分类',
            ],
            [
                'name'        => '案例分类管理',
                'slug'        => 'admin.case-cate.index',
                'menus_id'    => 39,
                'description' => '案例分类管理',
            ],
            [
                'name'        => '添加案例分类',
                'slug'        => 'admin.case-cate.create',
                'menus_id'    => 39,
                'description' => '添加案例分类',
            ],
            [
                'name'        => '编辑案例分类',
                'slug'        => 'admin.case-cate.edit',
                'menus_id'    => 39,
                'description' => '编辑案例分类',
            ],
            [
                'name'        => '删除案例分类',
                'slug'        => 'admin.case-cate.destroy',
                'menus_id'    => 39,
                'description' => '删除案例分类',
            ],
            [
                'name'        => '案例管理',
                'slug'        => 'admin.case.index',
                'menus_id'    => 8,
                'description' => '案例管理',
            ],
            [
                'name'        => '添加案例',
                'slug'        => 'admin.case.create',
                'menus_id'    => 8,
                'description' => '添加案例',
            ],
            [
                'name'        => '编辑案例',
                'slug'        => 'admin.case.edit',
                'menus_id'    => 8,
                'description' => '编辑案例',
            ],
            [
                'name'        => '删除案例',
                'slug'        => 'admin.case.destroy',
                'menus_id'    => 8,
                'description' => '删除案例',
            ],
            [
                'name'        => '视频分类管理',
                'slug'        => 'admin.video-cate.index',
                'menus_id'    => 41,
                'description' => '视频分类管理',
            ],
            [
                'name'        => '添加视频分类',
                'slug'        => 'admin.video-cate.create',
                'menus_id'    => 41,
                'description' => '添加视频分类',
            ],
            [
                'name'        => '编辑视频分类',
                'slug'        => 'admin.video-cate.edit',
                'menus_id'    => 41,
                'description' => '编辑视频分类',
            ],
            [
                'name'        => '删除视频分类',
                'slug'        => 'admin.video-cate.destroy',
                'menus_id'    => 41,
                'description' => '删除视频分类',
            ],
            [
                'name'        => '视频管理',
                'slug'        => 'admin.video.index',
                'menus_id'    => 10,
                'description' => '视频管理',
            ],
            [
                'name'        => '添加视频',
                'slug'        => 'admin.video.create',
                'menus_id'    => 10,
                'description' => '添加视频',
            ],
            [
                'name'        => '编辑视频',
                'slug'        => 'admin.video.edit',
                'menus_id'    => 10,
                'description' => '编辑视频',
            ],
            [
                'name'        => '删除视频',
                'slug'        => 'admin.video.destroy',
                'menus_id'    => 10,
                'description' => '删除视频',
            ],
            [
                'name'        => '新闻分类管理',
                'slug'        => 'admin.news-cate.index',
                'menus_id'    => 40,
                'description' => '新闻分类管理',
            ],
            [
                'name'        => '添加新闻分类',
                'slug'        => 'admin.news-cate.create',
                'menus_id'    => 40,
                'description' => '添加新闻分类',
            ],
            [
                'name'        => '编辑新闻分类',
                'slug'        => 'admin.news-cate.edit',
                'menus_id'    => 40,
                'description' => '编辑新闻分类',
            ],
            [
                'name'        => '删除新闻分类',
                'slug'        => 'admin.news-cate.destroy',
                'menus_id'    => 40,
                'description' => '删除新闻分类',
            ],
            [
                'name'        => '新闻管理',
                'slug'        => 'admin.news.index',
                'menus_id'    => 9,
                'description' => '新闻管理',
            ],
            [
                'name'        => '添加新闻',
                'slug'        => 'admin.news.create',
                'menus_id'    => 9,
                'description' => '添加新闻',
            ],
            [
                'name'        => '编辑新闻',
                'slug'        => 'admin.news.edit',
                'menus_id'    => 9,
                'description' => '编辑新闻',
            ],
            [
                'name'        => '删除新闻',
                'slug'        => 'admin.news.destroy',
                'menus_id'    => 9,
                'description' => '删除新闻',
            ],
            [
                'name'        => '招聘分类管理',
                'slug'        => 'admin.job-cate.index',
                'menus_id'    => 43,
                'description' => '招聘分类管理',
            ],
            [
                'name'        => '添加招聘分类',
                'slug'        => 'admin.job-cate.create',
                'menus_id'    => 43,
                'description' => '添加新闻',
            ],
            [
                'name'        => '编辑招聘分类',
                'slug'        => 'admin.job-cate.edit',
                'menus_id'    => 43,
                'description' => '编辑招聘分类',
            ],
            [
                'name'        => '删除招聘分类',
                'slug'        => 'admin.job-cate.destroy',
                'menus_id'    => 43,
                'description' => '删除招聘分类',
            ],
            [
                'name'        => '招聘管理',
                'slug'        => 'admin.job.index',
                'menus_id'    => 12,
                'description' => '招聘管理',
            ],
            [
                'name'        => '添加招聘',
                'slug'        => 'admin.job.create',
                'menus_id'    => 12,
                'description' => '添加招聘',
            ],
            [
                'name'        => '编辑招聘',
                'slug'        => 'admin.job.edit',
                'menus_id'    => 12,
                'description' => '编辑招聘',
            ],
            [
                'name'        => '删除招聘',
                'slug'        => 'admin.job.destroy',
                'menus_id'    => 12,
                'description' => '删除招聘',
            ],
            [
                'name'        => '下载分类管理',
                'slug'        => 'admin.download-cate.index',
                'menus_id'    => 42,
                'description' => '下载分类管理',
            ],
            [
                'name'        => '添加下载分类',
                'slug'        => 'admin.download-cate.create',
                'menus_id'    => 42,
                'description' => '添加下载分类',
            ],
            [
                'name'        => '编辑下载分类',
                'slug'        => 'admin.download-cate.edit',
                'menus_id'    => 42,
                'description' => '编辑下载分类',
            ],
            [
                'name'        => '删除下载分类',
                'slug'        => 'admin.download-cate.destroy',
                'menus_id'    => 42,
                'description' => '删除下载分类',
            ],
            [
                'name'        => '下载管理',
                'slug'        => 'admin.download.index',
                'menus_id'    => 11,
                'description' => '下载管理',
            ],
            [
                'name'        => '添加下载',
                'slug'        => 'admin.download.create',
                'menus_id'    => 11,
                'description' => '添加下载',
            ],
            [
                'name'        => '编辑下载',
                'slug'        => 'admin.download.edit',
                'menus_id'    => 11,
                'description' => '编辑下载',
            ],
            [
                'name'        => '删除下载',
                'slug'        => 'admin.download.destroy',
                'menus_id'    => 11,
                'description' => '删除下载',
            ],
            [
                'name'        => '模板语言管理',
                'slug'        => 'admin.view-lang.index',
                'menus_id'    => 34,
                'description' => '模板语言管理',
            ],
            [
                'name'        => '添加模板语言',
                'slug'        => 'admin.view-lang.create',
                'menus_id'    => 34,
                'description' => '添加模板语言',
            ],
            [
                'name'        => '编辑模板语言',
                'slug'        => 'admin.view-lang.edit',
                'menus_id'    => 34,
                'description' => '编辑模板语言',
            ],
            [
                'name'        => '删除模板语言',
                'slug'        => 'admin.view-lang.destroy',
                'menus_id'    => 34,
                'description' => '删除模板语言',
            ],
            [
                'name'        => '系统语言管理',
                'slug'        => 'admin.system-lang.index',
                'menus_id'    => 51,
                'description' => '系统语言管理',
            ],
            [
                'name'        => '添加系统语言',
                'slug'        => 'admin.system-lang.create',
                'menus_id'    => 51,
                'description' => '添加系统语言',
            ],
            [
                'name'        => '编辑系统语言',
                'slug'        => 'admin.system-lang.edit',
                'menus_id'    => 51,
                'description' => '编辑系统语言',
            ],
            [
                'name'        => '删除系统语言',
                'slug'        => 'admin.system-lang.destroy',
                'menus_id'    => 51,
                'description' => '删除系统语言',
            ],
            [
                'name'        => '用户管理',
                'slug'        => 'admin.user.index',
                'menus_id'    => 45,
                'description' => '用户管理',
            ],
            [
                'name'        => '添加用户',
                'slug'        => 'admin.user.create',
                'menus_id'    => 45,
                'description' => '添加用户',
            ],
            [
                'name'        => '编辑用户',
                'slug'        => 'admin.user.edit',
                'menus_id'    => 45,
                'description' => '编辑用户',
            ],
            [
                'name'        => '删除用户',
                'slug'        => 'admin.user.destroy',
                'menus_id'    => 45,
                'description' => '删除用户',
            ],
            [
                'name'        => '角色管理',
                'slug'        => 'admin.role.index',
                'menus_id'    => 46,
                'description' => '角色管理',
            ],
            [
                'name'        => '添加角色',
                'slug'        => 'admin.role.create',
                'menus_id'    => 46,
                'description' => '添加角色',
            ],
            [
                'name'        => '编辑角色',
                'slug'        => 'admin.role.edit',
                'menus_id'    => 46,
                'description' => '编辑角色',
            ],
            [
                'name'        => '删除角色',
                'slug'        => 'admin.role.destroy',
                'menus_id'    => 46,
                'description' => '删除角色',
            ],
            [
                'name'        => '权限管理',
                'slug'        => 'admin.permission.index',
                'menus_id'    => 47,
                'description' => '权限管理',
            ],
            [
                'name'        => '添加权限',
                'slug'        => 'admin.permission.create',
                'menus_id'    => 47,
                'description' => '添加权限',
            ],
            [
                'name'        => '编辑权限',
                'slug'        => 'admin.permission.edit',
                'menus_id'    => 47,
                'description' => '编辑权限',
            ],
            [
                'name'        => '删除权限',
                'slug'        => 'admin.permission.destroy',
                'menus_id'    => 47,
                'description' => '删除权限',
            ],
            [
                'name'        => '导航管理',
                'slug'        => 'admin.nav.index',
                'menus_id'    => 32,
                'description' => '导航管理',
            ],
            [
                'name'        => '添加导航',
                'slug'        => 'admin.nav.create',
                'menus_id'    => 32,
                'description' => '添加导航',
            ],
            [
                'name'        => '编辑导航',
                'slug'        => 'admin.nav.edit',
                'menus_id'    => 32,
                'description' => '编辑导航',
            ],
            [
                'name'        => '删除导航',
                'slug'        => 'admin.nav.destroy',
                'menus_id'    => 32,
                'description' => '删除导航',
            ],
            [
                'name'        => '标签管理',
                'slug'        => 'admin.tag.index',
                'menus_id'    => 18,
                'description' => '标签管理',
            ],
            [
                'name'        => '添加标签',
                'slug'        => 'admin.tag.create',
                'menus_id'    => 18,
                'description' => '添加标签',
            ],
            [
                'name'        => '编辑标签',
                'slug'        => 'admin.tag.edit',
                'menus_id'    => 18,
                'description' => '编辑标签',
            ],
            [
                'name'        => '删除标签',
                'slug'        => 'admin.tag.destroy',
                'menus_id'    => 18,
                'description' => '删除标签',
            ],
            [
                'name'        => '留言管理',
                'slug'        => 'admin.message.index',
                'menus_id'    => 17,
                'description' => '留言管理',
            ],
            [
                'name'        => '添加留言',
                'slug'        => 'admin.message.create',
                'menus_id'    => 17,
                'description' => '添加留言',
            ],
            [
                'name'        => '编辑留言',
                'slug'        => 'admin.message.edit',
                'menus_id'    => 17,
                'description' => '编辑留言',
            ],
            [
                'name'        => '删除留言',
                'slug'        => 'admin.message.destroy',
                'menus_id'    => 17,
                'description' => '删除留言',
            ],
            [
                'name'        => '查看留言',
                'slug'        => 'admin.message.show',
                'menus_id'    => 17,
                'description' => '查看留言',
            ],
            [
                'name'        => '友情链接管理',
                'slug'        => 'admin.link.index',
                'menus_id'    => 16,
                'description' => '友情链接管理',
            ],
            [
                'name'        => '添加友情链接',
                'slug'        => 'admin.link.create',
                'menus_id'    => 16,
                'description' => '添加友情链接',
            ],
            [
                'name'        => '编辑友情链接',
                'slug'        => 'admin.link.edit',
                'menus_id'    => 16,
                'description' => '编辑友情链接',
            ],
            [
                'name'        => '删除友情链接',
                'slug'        => 'admin.link.destroy',
                'menus_id'    => 16,
                'description' => '删除友情链接',
            ],
            [
                'name'        => '广告管理',
                'slug'        => 'admin.ad.index',
                'menus_id'    => 15,
                'description' => '广告管理',
            ],
            [
                'name'        => '添加广告',
                'slug'        => 'admin.ad.create',
                'menus_id'    => 15,
                'description' => '添加广告',
            ],
            [
                'name'        => '编辑广告',
                'slug'        => 'admin.ad.edit',
                'menus_id'    => 15,
                'description' => '编辑广告',
            ],
            [
                'name'        => '删除广告',
                'slug'        => 'admin.ad.destroy',
                'menus_id'    => 15,
                'description' => '删除广告',
            ],
            [
                'name'        => '添加图片信息',
                'slug'        => 'admin.ad.imgadd',
                'menus_id'    => 15,
                'description' => '添加图片信息',
            ],
            [
                'name'        => '删除图片信息',
                'slug'        => 'admin.ad.imgdel',
                'menus_id'    => 15,
                'description' => '删除图片信息',
            ],
            [
                'name'        => '获取图片信息',
                'slug'        => 'admin.ad.imgget',
                'menus_id'    => 15,
                'description' => '获取图片信息',
            ],
            [
                'name'        => '说明页管理',
                'slug'        => 'admin.block.index',
                'menus_id'    => 14,
                'description' => '说明页管理',
            ],
            [
                'name'        => '添加说明页',
                'slug'        => 'admin.block.create',
                'menus_id'    => 14,
                'description' => '添加说明页',
            ],
            [
                'name'        => '编辑说明页',
                'slug'        => 'admin.block.edit',
                'menus_id'    => 14,
                'description' => '编辑说明页',
            ],
            [
                'name'        => '删除说明页',
                'slug'        => 'admin.block.destroy',
                'menus_id'    => 14,
                'description' => '删除说明页',
            ],
            [
                'name'        => '语言版本管理',
                'slug'        => 'admin.lang.index',
                'menus_id'    => 26,
                'description' => '语言版本管理',
            ],
            [
                'name'        => '添加语言版本',
                'slug'        => 'admin.lang.create',
                'menus_id'    => 26,
                'description' => '添加语言版本',
            ],
            [
                'name'        => '编辑语言版本',
                'slug'        => 'admin.lang.edit',
                'menus_id'    => 26,
                'description' => '编辑语言版本',
            ],
            [
                'name'        => '语言版本启用',
                'slug'        => 'admin.lang.buy',
                'menus_id'    => 26,
                'description' => '语言版本启用',
            ],
            [
                'name'        => '切换主语言版本',
                'slug'        => 'admin.lang.prime',
                'menus_id'    => 26,
                'description' => '切换主语言版本',
            ],
            [
                'name'        => '删除语言版本',
                'slug'        => 'admin.lang.destroy',
                'menus_id'    => 26,
                'description' => '删除语言版本',
            ],
            [
                'name'        => '菜单管理',
                'slug'        => 'admin.menu.index',
                'menus_id'    => 4,
                'description' => '菜单管理',
            ],
            [
                'name'        => '添加菜单',
                'slug'        => 'admin.menu.create',
                'menus_id'    => 4,
                'description' => '添加菜单',
            ],
            [
                'name'        => '编辑菜单',
                'slug'        => 'admin.menu.edit',
                'menus_id'    => 4,
                'description' => '编辑菜单',
            ],
            [
                'name'        => '删除菜单',
                'slug'        => 'admin.menu.destroy',
                'menus_id'    => 4,
                'description' => '删除菜单',
            ],
            [
                'name'        => '属性管理',
                'slug'        => 'admin.attribute.index',
                'menus_id'    => 52,
                'description' => '属性管理',
            ],
            [
                'name'        => '添加属性',
                'slug'        => 'admin.attribute.create',
                'menus_id'    => 52,
                'description' => '添加属性',
            ],
            [
                'name'        => '编辑属性',
                'slug'        => 'admin.attribute.edit',
                'menus_id'    => 52,
                'description' => '编辑属性',
            ],
            [
                'name'        => '删除属性',
                'slug'        => 'admin.attribute.destroy',
                'menus_id'    => 52,
                'description' => '删除属性',
            ],
            [
                'name'        => '品牌管理',
                'slug'        => 'admin.manufacturer.index',
                'menus_id'    => 53,
                'description' => '品牌管理',
            ],
            [
                'name'        => '添加品牌',
                'slug'        => 'admin.manufacturer.create',
                'menus_id'    => 53,
                'description' => '添加品牌',
            ],
            [
                'name'        => '编辑品牌',
                'slug'        => 'admin.manufacturer.edit',
                'menus_id'    => 53,
                'description' => '编辑品牌',
            ],
            [
                'name'        => '删除品牌',
                'slug'        => 'admin.manufacturer.destroy',
                'menus_id'    => 53,
                'description' => '删除品牌',
            ],
            [
                'name'        => '风格管理',
                'slug'        => 'admin.theme.index',
                'menus_id'    => 35,
                'description' => '风格管理',
            ],
            [
                'name'        => '更多风格选择',
                'slug'        => 'admin.theme.install',
                'menus_id'    => 35,
                'description' => '更多风格选择',
            ],
            [
                'name'        => '风格下载',
                'slug'        => 'admin.theme.download',
                'menus_id'    => 35,
                'description' => '风格下载',
            ],
            [
                'name'        => '风格启用',
                'slug'        => 'admin.theme.change',
                'menus_id'    => 35,
                'description' => '风格启用',
            ],
            [
                'name'        => '视频培训',
                'slug'        => 'admin.train.video',
                'menus_id'    => 72,
                'description' => '视频培训',
            ],
            [
                'name'        => '视频详细',
                'slug'        => 'admin.train.video-detail',
                'menus_id'    => 72,
                'description' => '视频详细',
            ],
            [
                'name'        => '在线资讯',
                'slug'        => 'admin.train.news',
                'menus_id'    => 73,
                'description' => '在线资讯',
            ],
            [
                'name'        => '在线资讯详细',
                'slug'        => 'admin.train.news-detail',
                'menus_id'    => 73,
                'description' => '在线资讯详细',
            ],
            [
                'name'        => '意见反馈',
                'slug'        => 'admin.user.opinion',
                'menus_id'    => 2,
                'description' => '意见反馈',
            ],
            [
                'name'        => '异步更新tag',
                'slug'        => 'admin.tag.ajax-update',
                'menus_id'    => 18,
                'description' => '异步更新tag',
            ],
            [
                'name'        => '社交授权管理',
                'slug'        => 'admin.social.index',
                'menus_id'    => 93,
                'description' => '社交授权管理',
            ],
            [
                'name'        => '添加社交授权',
                'slug'        => 'admin.social.create',
                'menus_id'    => 93,
                'description' => '添加社交授权',
            ],
            [
                'name'        => '社交重新授权',
                'slug'        => 'admin.social.edit',
                'menus_id'    => 93,
                'description' => '社交重新授权',
            ],
            [
                'name'        => '删除社交授权',
                'slug'        => 'admin.social.destroy',
                'menus_id'    => 93,
                'description' => '删除社交授权',
            ],
            [
                'name'        => '社交分享列表',
                'slug'        => 'admin.social-share.index',
                'menus_id'    => 92,
                'description' => '社交分享列表',
            ],
            [
                'name'        => '添加社交分享',
                'slug'        => 'admin.social-share.create',
                'menus_id'    => 92,
                'description' => '添加社交分享',
            ],
            [
                'name'        => '删除社交分享',
                'slug'        => 'admin.social-share.destroy',
                'menus_id'    => 92,
                'description' => '删除社交分享',
            ],
        ];

        Permission::createAll($array);

        //给角色添加所有权限
        \App\Models\Role::find(1)->attachPermission(array_pluck(Permission::all()->toArray(), 'id')); 
    }
}
