Support the ongoing development of Laravel.io →
Requests Input Architecture
Last updated 1 year 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 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

nkiermaier nkiermaier Joined 11 Sep 2014

Moderators

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

Your logo here?

Laravel.io

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

© 2024 Laravel.io - All rights reserved.