【发布时间】:2015-08-29 17:44:33
【问题描述】:
我在 Laravel 4.2 中创建一个应用程序,当我创建一个模型时,我得到一个找不到它的异常:
模型/Annulations.php:
class Annulation extends Eloquent {
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'annulation_remboursement';
控制器/AnnulationsController.php:
class AnnulationsController extends \BaseController {
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$annulations = Annulation::all();
return View::make('Annulations.index')->withAnnulations($annulations);
}
在stackoverflow上,我找到了关于命令的解决方案:
$ php artisan dump-autoload
如果我尝试这个命令,那么我仍然有这个错误: 未找到“Annulation”类
你能帮帮我吗?
【问题讨论】:
-
composer dump-autoload?
标签: model-view-controller laravel-4