| Conditions | 2 |
| Paths | 2 |
| Total Lines | 46 |
| Code Lines | 27 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function up() |
||
| 16 | { |
||
| 17 | Schema::create('roles', function (Blueprint $table) { |
||
| 18 | $table->id(); |
||
| 19 | $table->string('name'); |
||
| 20 | $table->text('description')->nullable(); |
||
| 21 | $table->integer('level')->default(0); |
||
| 22 | $table->timestamps(); |
||
| 23 | }); |
||
| 24 | |||
| 25 | // Migrate with dummy |
||
| 26 | if (config('adminetic.migrate_with_dummy', false)) { |
||
| 27 | $roles = [ |
||
| 28 | [ |
||
| 29 | 'name' => 'superadmin', |
||
| 30 | 'description' => 'This is a super admin user', |
||
| 31 | 'level' => 5, |
||
| 32 | ], |
||
| 33 | [ |
||
| 34 | 'name' => 'admin', |
||
| 35 | 'description' => 'This is an admin user', |
||
| 36 | 'level' => 4, |
||
| 37 | ], |
||
| 38 | [ |
||
| 39 | 'name' => 'moderator', |
||
| 40 | 'description' => 'This is an moderator', |
||
| 41 | 'level' => 3, |
||
| 42 | ], |
||
| 43 | [ |
||
| 44 | 'name' => 'editor', |
||
| 45 | 'description' => 'This is an editor', |
||
| 46 | 'level' => 2, |
||
| 47 | ], |
||
| 48 | [ |
||
| 49 | 'name' => 'user', |
||
| 50 | 'description' => 'This is an normal user', |
||
| 51 | 'level' => 1, |
||
| 52 | ], |
||
| 53 | [ |
||
| 54 | 'name' => 'unverified', |
||
| 55 | 'description' => 'This is an unverified user', |
||
| 56 | 'level' => 0, |
||
| 57 | ], |
||
| 58 | ]; |
||
| 59 | |||
| 60 | DB::table('roles')->insert($roles); |
||
| 61 | } |
||
| 74 |