1

In laravel 11 i setup my route like this :

      then: function(){
                Route::middleware(['web', 'admin'])->prefix('admin')->name('admin.')->group(base_path('routes/admin.php'));
                Route::middleware(['web', 'user'])->prefix('u/{userid?}')->name('user.')->group(base_path('routes/user.php'));
            },

but there is a problem when i want to each any route of user.php file: i need to add userid parameter each time

can i automate this process so the userid will automatically injected to the route

I don't want to write this type of syntax each time :

<a href="{{ route("user.comment.create", Auth::id()) }}"></a>

I think laravel have the good approach for this : I want to use that approach !

anyone tell me the right way to do this...

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.