These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | /* |
||
4 | * NOTICE OF LICENSE |
||
5 | * |
||
6 | * Part of the Rinvex Fort Package. |
||
7 | * |
||
8 | * This source file is subject to The MIT License (MIT) |
||
9 | * that is bundled with this package in the LICENSE file. |
||
10 | * |
||
11 | * Package: Rinvex Fort Package |
||
12 | * License: The MIT License (MIT) |
||
13 | * Link: https://rinvex.com |
||
14 | */ |
||
15 | |||
16 | use Illuminate\Support\Facades\Schema; |
||
17 | use Illuminate\Database\Schema\Blueprint; |
||
18 | use Illuminate\Database\Migrations\Migration; |
||
19 | |||
20 | class CreateRinvexFortAbilityUserTable extends Migration |
||
0 ignored issues
–
show
|
|||
21 | { |
||
22 | /** |
||
23 | * Run the migrations. |
||
24 | * |
||
25 | * @return void |
||
26 | */ |
||
27 | public function up() |
||
28 | { |
||
29 | Schema::create(config('rinvex.fort.tables.ability_user'), function (Blueprint $table) { |
||
0 ignored issues
–
show
The method
create() does not exist on Illuminate\Support\Facades\Schema . Did you maybe mean createFreshMockInstance() ?
This check marks calls to methods that do not seem to exist on an object. This is most likely the result of a method being renamed without all references to it being renamed likewise.
Loading history...
|
|||
30 | // Columns |
||
31 | $table->integer('ability_id')->unsigned(); |
||
32 | $table->integer('user_id')->unsigned(); |
||
33 | $table->timestamps(); |
||
34 | |||
35 | // Indexes |
||
36 | $table->primary([ |
||
37 | 'ability_id', |
||
38 | 'user_id', |
||
39 | ]); |
||
40 | $table->foreign('ability_id') |
||
41 | ->references('id') |
||
42 | ->on(config('rinvex.fort.tables.abilities')) |
||
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 | |||
56 | /** |
||
57 | * Reverse the migrations. |
||
58 | * |
||
59 | * @return void |
||
60 | */ |
||
61 | public function down() |
||
62 | { |
||
63 | Schema::drop(config('rinvex.fort.tables.ability_user')); |
||
64 | } |
||
65 | } |
||
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.