0
我是laravel的新手,並嘗試創建下表。下面的代碼是在我的「route.php」文件::在Laravel中創建表格異常
Route::get("userDatabase", function(){
Schema::create("users", function($table){
$table->increments('id');
$table->string('username', 32);
$table->string('email', 320);
$table->string('password', 60);
$table->timestamps();
});
});
當我訪問http://localhost/laravel/public/userDatabase
我得到以下異常:
RuntimeException
PDOException was thrown when trying to read the session data: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel.sessions' doesn't exist
在「database.php中」文件中的數據庫配置是正確的,而且沒有任何問題。
我在做什麼錯誤,是什麼導致此異常?
感謝
或者改爲手動創建表格,請調用'artisan session:table && artisan migrate'讓laravel爲您處理。 – 2014-09-20 13:31:33