| Conditions | 1 |
| Paths | 1 |
| Total Lines | 19 |
| Code Lines | 13 |
| Lines | 11 |
| Ratio | 57.89 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public function up() |
||
| 22 | { |
||
| 23 | View Code Duplication | Schema::create($this->table_attachments, function(Blueprint $table) { |
|
| 24 | $table->increments('id'); |
||
| 25 | $table->string('name'); |
||
| 26 | $table->string('original_name'); |
||
| 27 | $table->text('description')->nullable(); |
||
| 28 | $table->boolean('is_main')->default(false)->index(); |
||
| 29 | $table->integer('user_id')->nullable()->unsigned()->index(); |
||
| 30 | $table->timestamps(); |
||
| 31 | |||
| 32 | $table->foreign('user_id')->references('id')->on('users')->onDelete('SET NULL')->onUpdate('CASCADE'); |
||
| 33 | }); |
||
| 34 | |||
| 35 | Schema::create('attachables', function(Blueprint $table) { |
||
| 36 | $table->integer('attachment_id')->unsigned(); |
||
| 37 | $table->morphs('attachable'); |
||
| 38 | }); |
||
| 39 | } |
||
| 40 | |||
| 52 |
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.