Support the ongoing development of Laravel.io →
posted 9 years ago
Requests
Last updated 1 year ago.
0

When u set a pattern, then this will apply to all routes that use {id}.

In your controller you can get the the parameter like:


    public function edit($id) {

        $user = Sentry::findUserById($id);
        return View::make('backend.user.edit', compact('user'));
    }

Does this not work? And did you try to pass parameters that are not numbers?

Last updated 1 year ago.
0

And did you try to pass parameters that are not numbers?

Yes, I was hoped check a parameters type in routes. Otherwise I will be have a lot of duplicated code.

I'm begginer in the Laravel and do not know how to better organize a common code to avoid duplications.

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

laraveler laraveler Joined 27 Aug 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.