Conditions | 1 |
Paths | 1 |
Total Lines | 18 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
14 | public function up() |
||
15 | { |
||
16 | Schema::create('blog', function (Blueprint $table) { |
||
17 | $table->increments('id'); |
||
18 | $table->integer('user_id')->unsigned(); |
||
19 | $table->string('title'); |
||
20 | $table->string('slug', 120)->unique(); |
||
21 | $table->longtext('content'); |
||
22 | $table->softDeletes(); |
||
23 | $table->timestamps(); |
||
24 | |||
25 | // Delete articles if the user is deleted |
||
26 | $table->foreign('user_id') |
||
27 | ->references('id') |
||
28 | ->on('users') |
||
29 | ->onDelete('cascade'); |
||
30 | }); |
||
31 | } |
||
32 | |||
43 |
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.