我将Laravel Stapler用于图像目的,并且在迁移新表后,我尝试使用artisan migration:refresh之后再显示此错误:
[Symfony\Component\Debug\Exception\FatalErrorException]
Class ‘AddPhotoFieldsToStaffTable’ not found
但是,在尝试–refresh之前,我可以看到我的迁移文件夹中的文件并使用PHP artisan migration,文件已成功迁移!
class AddPhotoFieldsToStaffTable extends Migration {
/**
* Make changes to the table.
*
* @return void
*/
public function up()
{
Schema::table('staff', function(Blueprint $table) {
$table->string('photo_file_name')->nullable();
$table->integer('photo_file_size')->nullable()->after('photo_file_name');
$table->string('photo_content_type')->nullable()->after('photo_file_size');
$table->timestamp('photo_updated_at')->nullable()->after('photo_content_type');
});
}
/**
* Revert the changes to the table.
*
* @return void
*/
public function down()
{
Schema::table('staff', function(Blueprint $table) {
$table->dropColumn('photo_file_name');
$table->dropColumn('photo_file_size');
$table->dropColumn('photo_content_type');
$table->dropColumn('photo_updated_at');
});
}
}
任何帮助将不胜感激.
解决方法:
使用作曲家dumpautoload解决了这个问题.