routes.php第51行中的FatalErrorException:类'app \ Game'未找到laravel 5.1

时间:2015-07-17 15:12:17

标签: php model eloquent laravel-5 laravel-routing

这是我的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();

});

1 个答案:

答案 0 :(得分:1)

你需要在App \ Game中拥有Capital A吗?