| Conditions | 1 |
| Paths | 1 |
| Total Lines | 33 |
| Code Lines | 23 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 13 | public function up() |
||
| 14 | { |
||
| 15 | |||
| 16 | Schema::create('BlogCategory', function (Blueprint $table) { |
||
| 17 | $table->increments('id'); |
||
| 18 | $table->string('name', 100); |
||
| 19 | $table->string('description', 250); |
||
| 20 | |||
| 21 | $table->timestamps(); |
||
| 22 | $table->softDeletes(); |
||
| 23 | $table->creation(); |
||
| 24 | }); |
||
| 25 | |||
| 26 | Schema::create('BlogPost', function (Blueprint $table) { |
||
| 27 | $table->increments('id'); |
||
| 28 | $table->string('title', 100); |
||
| 29 | $table->text('contents'); |
||
| 30 | $table->integer('category')->unsigned(); |
||
| 31 | $table->integer('author')->unsigned(); |
||
| 32 | $table->integer('likes')->default(0); |
||
| 33 | $table->integer('shares')->default(0); |
||
| 34 | $table->integer('views')->default(0); |
||
| 35 | $table->string('keywords', 250); |
||
| 36 | |||
| 37 | $table->timestamps(); |
||
| 38 | $table->softDeletes(); |
||
| 39 | $table->creation(); |
||
| 40 | |||
| 41 | $table->foreign('category')->references('id')->on('BlogCategory'); |
||
| 42 | $table->foreign('author')->references('id')->on('User'); |
||
| 43 | }); |
||
| 44 | |||
| 45 | } |
||
| 46 | |||
| 60 |
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.