| Total Complexity | 3 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class CreateSpatieRolesTable extends Migration |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Run the migrations. |
||
| 11 | * |
||
| 12 | * @return void |
||
| 13 | */ |
||
| 14 | public function up() |
||
| 15 | { |
||
| 16 | $tableNames = config('permission.table_names'); |
||
| 17 | |||
| 18 | Schema::create($tableNames['roles'], function (Blueprint $table) { |
||
| 19 | $table->bigIncrements('id'); |
||
| 20 | $table->string('name'); |
||
| 21 | $table->string('guard_name'); |
||
| 22 | $table->timestamps(); |
||
| 23 | }); |
||
| 24 | |||
| 25 | app('cache') |
||
| 26 | ->store(config('permission.cache.store') != 'default' ? config('permission.cache.store') : null) |
||
| 27 | ->forget(config('permission.cache.key')); |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Reverse the migrations. |
||
| 32 | * |
||
| 33 | * @return void |
||
| 34 | */ |
||
| 35 | public function down() |
||
| 36 | { |
||
| 37 | $tableNames = config('permission.table_names'); |
||
| 38 | |||
| 39 | Schema::drop($tableNames['roles']); |
||
| 40 | } |
||
| 42 |