I follow Laravel 4 tutorial at http://codebright.daylerees.com/.
at codebright.daylerees.com/controllers , you can see RESTful Controllers tutorial
I arrived at advanced routing tutorial codebright.daylerees.com/advanced-routing.
There is a sample code to use Route::get with named routes. Then I try to use Route::controller to make RESTful URI with named routes. Then, I try to write this code one routes.php:
Route::controller('my/very/long/article/route2', array(
'as'=>'article2',
'uses'=>'Blog\Controller\Article'
));
This is my controller/Article.php code:
<?php
namespace Blog\Controller;
use View;
use BaseController;
class Article extends BaseController
{
public function getCreate()
{
return View::make('create');
}
public function postCreate()
{
}
}
When I try to access my/very/long/article/route2/create, it shows error
ErrorException
Array to string conversion
…\vendor\laravel\framework\src\Illuminate\Routing\Controllers\Inspector.php
Any idea how to implement named routes to controller with RESTful?