这是我的Game.php
模型类代码,它位于app
目录中
namespace App;
use Illuminate\Database\Eloquent\Model;
class Game extends Model
{
}
并在我的routes.php
<?php
use app\Game;
Route::get('game',function(){
$game = new app\Game;
$game->name = 'Assassins Creed';
$game->description = 'Assassins VS templars.';
$game->save();
});
答案 0 :(得分:1)
你需要在App \ Game中拥有Capital A吗?