| 1 | <?php |
||
| 4 | class CreateRolesToRightTable |
||
|
|
|||
| 5 | { |
||
| 6 | /** |
||
| 7 | * Do the migration |
||
| 8 | */ |
||
| 9 | public function up() |
||
| 10 | { |
||
| 11 | Capsule::schema()->create('roles_to_rights', function($table) { |
||
| 12 | $table->integer('role_id')->unsigned(); |
||
| 13 | $table->integer('right_id')->unsigned(); |
||
| 14 | $table->primary(['role_id', 'right_id']); |
||
| 15 | }); |
||
| 16 | |||
| 17 | } |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Undo the migration |
||
| 21 | */ |
||
| 22 | public function down() |
||
| 26 | } |
||
| 27 |
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.