Support the ongoing development of Laravel.io →
Requests Input Architecture
Last updated 3 months ago.
0

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.

Last updated 3 months ago.
0

Sign in to participate in this thread!

LoadForge

Your banner here too?

nkiermaier nkiermaier nkiermaier Joined 11 Sep 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.