Total Complexity | 3 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class CreateLangSwitcherTable extends Migration |
||
13 | { |
||
14 | /** |
||
15 | * Run the migrations. |
||
16 | * |
||
17 | * @return void |
||
18 | */ |
||
19 | public function up() |
||
20 | { |
||
21 | $connection=config('lang-switch.database.connection'); |
||
22 | if (!Schema::connection($connection)->hasTable('_lang_switcher')) { |
||
23 | Schema::connection($connection)->create('_lang_switcher', function (Blueprint $table) { |
||
24 | $table->increments('id'); |
||
25 | $table->string('class', 20)->default(''); |
||
26 | $table->string('method', 20)->default(''); |
||
27 | $table->string('middleware', 20)->default(''); |
||
28 | $table->tinyInteger('enable')->default(1); |
||
29 | |||
30 | $table->index('class', 'class'); |
||
31 | $table->index('method', 'method'); |
||
32 | $table->index('middleware', 'middleware'); |
||
33 | $table->index('enable', 'enable'); |
||
34 | }); |
||
35 | } |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * Reverse the migrations. |
||
40 | * |
||
41 | * @return void |
||
42 | */ |
||
43 | public function down() |
||
47 | } |
||
48 | } |
||
49 |