[英]Class CreateTableName Not found php artisan
when i typed in console - php artisan make:migration create_website_table --create=website
当我在控制台中键入时
php artisan make:migration create_website_table --create=website
than file created, I didn't edit anything and ran command php artisan migrate
比创建的文件要多,我没有编辑任何内容,而是运行了
php artisan migrate
命令
now i want to rollback it and it says 现在我想回滚它,它说
[Symfony\\Component\\Debug\\Exception\\FatalErrorException]
[Symfony的\\元器件\\调试\\异常\\ FatalErrorException]
Class 'CreateWebsiteTable' not found找不到类“ CreateWebsiteTable”
The code of my migration Website class 我的迁移网站课程的代码
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateWebsiteTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('website', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('website');
}
}
Maybe there is some namespaces? 也许有一些名称空间?
Before you run php artisan migrate
, run the following code composer dump-autoload
. 在运行
php artisan migrate
之前,请运行以下代码composer dump-autoload
。
Infact, whenever you get ClassNotFound
Exception, run the above command! 实际上,每当您收到
ClassNotFound
Exception时,请运行以上命令!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.