1
我想在我的數據庫但我CLASSE添加一個列上創建遷移:致命錯誤:類「」未找到,而在Laravel
我的班級名稱是add_meta_to_cities_table.php
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddMetaToCitiesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('cities', function (Blueprint $table) {
$table->text('meta_desc');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
}
}
就像我在composer dump-autoload
之前跑過的精度一樣。
當我試圖運行php artisan migrate
我最後會出現這個錯誤?
[Symfony\Component\Debug\Exception\FatalThrowableError]
Fatal error: Class 'Table' not found
這可能來自哪裏?
此遷移的文件名是什麼? –
在嘗試遷移之前是否運行'composer dump-autoload'? – Burak
剛剛更新的問題,是的我已經運行'dumpautoload'之前 –