Conditions | 1 |
Paths | 1 |
Total Lines | 26 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
13 | public function up() |
||
14 | { |
||
15 | Schema::create(config('promocodes.table', 'promocodes'), function (Blueprint $table) { |
||
16 | $table->increments('id'); |
||
17 | |||
18 | $table->string('code', 32)->unique(); |
||
19 | $table->double('reward', 10, 2)->nullable(); |
||
20 | |||
21 | $table->text('data')->nullable(); |
||
22 | |||
23 | $table->boolean('is_disposable')->default(false); |
||
24 | $table->timestamp('expires_at')->nullable(); |
||
25 | }); |
||
26 | |||
27 | Schema::create(config('promocodes.relation_table', 'promocode_user'), function (Blueprint $table) { |
||
28 | $table->unsignedInteger('user_id'); |
||
29 | $table->unsignedInteger('promocode_id'); |
||
30 | |||
31 | $table->timestamp('used_at'); |
||
32 | |||
33 | $table->primary(['user_id', 'promocode_id']); |
||
34 | |||
35 | $table->foreign('user_id')->references('id')->on('users'); |
||
36 | $table->foreign('promocode_id')->references('id')->on(config('promocodes.table', 'promocodes')); |
||
37 | }); |
||
38 | } |
||
39 | |||
51 |
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.