| Conditions | 1 |
| Paths | 1 |
| Total Lines | 47 |
| Code Lines | 31 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function up() |
||
| 15 | { |
||
| 16 | Schema::create('alive_messages', function (Blueprint $table) { |
||
| 17 | $table->increments('id'); |
||
| 18 | |||
| 19 | // From field |
||
| 20 | $table->unsignedInteger('from') |
||
| 21 | ->nullable() |
||
| 22 | ->index(); |
||
| 23 | |||
| 24 | $table->foreign('from') |
||
| 25 | ->references('id') |
||
| 26 | ->on('users') |
||
| 27 | ->onDelete('cascade') |
||
| 28 | ->onUpdate('cascade'); |
||
| 29 | |||
| 30 | // To field |
||
| 31 | $table->unsignedInteger('to') |
||
| 32 | ->nullable() |
||
| 33 | ->index(); |
||
| 34 | |||
| 35 | $table->foreign('to') |
||
| 36 | ->references('id') |
||
| 37 | ->on('users') |
||
| 38 | ->onDelete('cascade') |
||
| 39 | ->onUpdate('cascade'); |
||
| 40 | |||
| 41 | $table->string('body') |
||
| 42 | ->nullable(); |
||
| 43 | |||
| 44 | // to show message or not |
||
| 45 | $table->boolean('invisible') |
||
| 46 | ->default(false); |
||
| 47 | |||
| 48 | // Process field |
||
| 49 | $table->unsignedInteger('process_id') |
||
| 50 | ->index(); |
||
| 51 | |||
| 52 | $table->foreign('process_id') |
||
| 53 | ->references('id') |
||
| 54 | ->on('alive_message_processes') |
||
| 55 | ->onDelete('cascade') |
||
| 56 | ->onUpdate('cascade'); |
||
| 57 | |||
| 58 | $table->timestamps(); |
||
| 59 | }); |
||
| 60 | } |
||
| 61 | |||
| 72 |
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.