Personally I would just pass all the route parameters into the action method over using func_get_args with that said, coming in Laravel 5 we have FormRequest objects which will contain validation/auth rules aswell as all the URL parameters so your controller actions will look something like:
class ArticleController
{
public function read(ReadArticleRequest $request)
{
// $request will have all url properties
return 'You are reading article ' . $request->articleId . ', slug: ' . $request->articleSlug;
}
}
These FormRequests are going to be an absolute godsend, if you are not ready for production you may want to bump your version up and use the current dev-master branch of Laravel to get early access, we are only a few weeks from release after all.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community