Conditions | 1 |
Paths | 1 |
Total Lines | 28 |
Code Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
27 | public function up() |
||
28 | { |
||
29 | Schema::create(config('rinvex.fort.tables.role_user'), function (Blueprint $table) { |
||
30 | // Columns |
||
31 | $table->integer('role_id')->unsigned(); |
||
32 | $table->integer('user_id')->unsigned(); |
||
33 | $table->timestamps(); |
||
34 | |||
35 | // Indexes |
||
36 | $table->primary([ |
||
37 | 'role_id', |
||
38 | 'user_id', |
||
39 | ]); |
||
40 | $table->foreign('role_id') |
||
41 | ->references('id') |
||
42 | ->on(config('rinvex.fort.tables.roles')) |
||
43 | ->onDelete('cascade') |
||
44 | ->onUpdate('cascade'); |
||
45 | $table->foreign('user_id') |
||
46 | ->references('id') |
||
47 | ->on(config('rinvex.fort.tables.users')) |
||
48 | ->onDelete('cascade') |
||
49 | ->onUpdate('cascade'); |
||
50 | |||
51 | // Engine |
||
52 | $table->engine = 'InnoDB'; |
||
53 | }); |
||
54 | } |
||
55 | |||
66 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.