These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | use Illuminate\Database\Schema\Blueprint; |
||
6 | use Illuminate\Database\Migrations\Migration; |
||
7 | |||
8 | class CreatePlanSubscriptionUsageTable extends Migration |
||
0 ignored issues
–
show
|
|||
9 | { |
||
10 | /** |
||
11 | * Run the migrations. |
||
12 | * |
||
13 | * @return void |
||
14 | */ |
||
15 | public function up(): void |
||
16 | { |
||
17 | Schema::create(config('rinvex.subscriptions.tables.plan_subscription_usage'), function (Blueprint $table) { |
||
18 | $table->increments('id'); |
||
19 | $table->integer('subscription_id')->unsigned(); |
||
20 | $table->integer('feature_id')->unsigned(); |
||
21 | $table->smallInteger('used')->unsigned(); |
||
22 | $table->dateTime('valid_until')->nullable(); |
||
23 | $table->string('timezone')->nullable(); |
||
24 | $table->timestamps(); |
||
25 | $table->softDeletes(); |
||
26 | |||
27 | $table->unique(['subscription_id', 'feature_id']); |
||
28 | $table->foreign('subscription_id')->references('id')->on(config('rinvex.subscriptions.tables.plan_subscriptions')) |
||
0 ignored issues
–
show
|
|||
29 | ->onDelete('cascade')->onUpdate('cascade'); |
||
30 | $table->foreign('feature_id')->references('id')->on(config('rinvex.subscriptions.tables.plan_features')) |
||
31 | ->onDelete('cascade')->onUpdate('cascade'); |
||
32 | }); |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * Reverse the migrations. |
||
37 | * |
||
38 | * @return void |
||
39 | */ |
||
40 | public function down(): void |
||
41 | { |
||
42 | Schema::dropIfExists(config('rinvex.subscriptions.tables.plan_subscription_usage')); |
||
43 | } |
||
44 | } |
||
45 |
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.