我对laravel很陌生,并且用这个插件创建了一个“文章”支架:
https://github.com/JeffreyWay/Laravel-4-Generators
和跑步:
php artisan generate:resource article --fields="title:string, body:text"一切正常,在我的数据库中创建了表,相关的文件出现在我的项目目录中。但是,当我导航到localhost/laravel/public/ when (我的目录)时,我会得到以下错误:
ErrorException (E_NOTICE)
HELP
Undefined offset: 1
Open: C:\xampp\htdocs\laravel\vendor\laravel\framework\src\Illuminate\Routing\Router.php
$route = $this->current();
$request = $this->getCurrentRequest();
// Now we can split the controller and method out of the action string so that we
// can call them appropriately on the class. This controller and method are in
// in the Class@method format and we need to explode them out then use them.
list($class, $method) = explode('@', $controller);
return $d->dispatch($route, $request, $class, $method);我试着跑
php artisan optimize --force但这没什么用。
有什么建议吗?
发布于 2015-05-31 10:20:39
您必须为这样的文章添加路由:
Route::resource('articles', 'ArticlesController');在app/Broades.php文件中。
https://stackoverflow.com/questions/30546819
复制相似问题