错误:PhotoController.php第17行中的FatalErrorException:未找到类'App \ Http \ Controllers \ photo'
此代码出现异常 - > $ a = photo :: all();
**PhotoController **
<?php namespace App\Http\Controllers;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
class PhotoController extends Controller {
public function index()
{
$a = photo::all();
print_r($a);
}
**// Photo model**
<?php namespace App;
use Illuminate\Database\Eloquent\Model;
class Photo extends Model {
protected $table = 'users';
}
答案 0 :(得分:3)
替换控制器
namespace App\Http\Controllers;
use App\models\Photo;
替换模型
namespace App\models;
use Illuminate\Database\Eloquent\Model;