最佳答案
我不知道为什么在执行迁移时会发生这个错误,因为我没有重复的类。
移民:
2014_10_12_100000_create_password_resets_table.php
2019_01_18_020910_create_roles_table.php
2019_01_18_025535_create_members_table.php
2019_01_18_025536_create_users_table.php
2019_01_18_183649_create_projects_table.php
2019_01_18_184249_create_member_project_table.php
2019_01_18_184719_create_sprints_table.php
2019_01_18_185218_create_tasks_table.php
2019_01_21_033045_add_shortname_to_project.php
错误:
PHP Fatal error: Cannot declare class CreateRolesTable, because the name is already in use in
oyectos\database\migrations\2019_01_18_020910_create_roles_table.php on line 33
In 2019_01_18_020910_create_roles_table.php line 33:
Cannot declare class CreateRolesTable, because the name is already in use
班级:
class CreateRolesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('roles', function (Blueprint $table) {
$table->increments('id');
$table->string('name',128)->unique();
$table->string('description');
$table->boolean('system');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('roles');
}
}