Skip to content

Commit f48d918

Browse files
committed
迁移
1 parent 723e7ab commit f48d918

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

database/seeds/AdminInitSeeder.php

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
use Illuminate\Database\Seeder;
4+
5+
class AdminInitSeeder extends Seeder
6+
{
7+
/**
8+
* Run the database seeds.
9+
*
10+
* @return void
11+
*/
12+
public function run()
13+
{
14+
\App\Models\Admin\AdminUser::truncate();
15+
\App\Models\Admin\Permission::truncate();
16+
\DB::select(
17+
<<<SQL
18+
INSERT INTO `admin_permissions` (`id`, `name`, `label`, `description`, `cid`, `icon`, `created_at`, `updated_at`)
19+
VALUES
20+
(1, 'admin.permission', '权限管理', '111', 0, 'fa-users', '2016-05-21 10:06:50', '2016-06-22 13:49:09'),
21+
(2, 'admin.permission.index', '权限列表', '', 3, '', '2016-05-21 10:08:04', '2016-05-21 10:08:04'),
22+
(3, 'admin.permission.create', '权限添加', '', 3, '', '2016-05-21 10:08:18', '2016-05-21 10:08:18'),
23+
(4, 'admin.permission.edit', '权限修改', '', 3, '', '2016-05-21 10:08:35', '2016-05-21 10:08:35'),
24+
(5, 'admin.permission.destroy ', '权限删除', '', 3, '', '2016-05-21 10:09:57', '2016-05-21 10:09:57'),
25+
(6, 'admin.role.index', '角色列表', '', 3, '', '2016-05-23 10:36:40', '2016-05-23 10:36:40'),
26+
(7, 'admin.role.create', '角色添加', '', 3, '', '2016-05-23 10:37:07', '2016-05-23 10:37:07'),
27+
(8, 'admin.role.edit', '角色修改', '', 3, '', '2016-05-23 10:37:22', '2016-05-23 10:37:22'),
28+
(9, 'admin.role.destroy', '角色删除', '', 3, '', '2016-05-23 10:37:48', '2016-05-23 10:37:48'),
29+
(10, 'admin.user.index', '用户管理', '', 3, '', '2016-05-23 10:38:52', '2016-05-23 10:38:52'),
30+
(11, 'admin.user.create', '用户添加', '22', 3, '', '2016-05-23 10:39:21', '2016-06-22 13:49:29'),
31+
(12, 'admin.user.edit', '用户编辑', '', 3, '', '2016-05-23 10:39:52', '2016-05-23 10:39:52'),
32+
(13, 'admin.user.destroy', '用户删除', '', 3, '', '2016-05-23 10:40:36', '2016-05-23 10:40:36');
33+
SQL
34+
);
35+
$admin = new \App\Models\Admin\AdminUser();
36+
$admin->
37+
id = 1;
38+
$admin->name = 'root';
39+
$admin->email = '[email protected]';
40+
$admin->password = encrypt('root');
41+
$admin->save();
42+
}
43+
}

0 commit comments

Comments
 (0)