Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8543789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:23:32+00:00 2026-06-11T12:23:32+00:00

Is there a way to cleanly group all routes starting with admin/ ? I

  • 0

Is there a way to cleanly group all routes starting with admin/?
I tried something like this, but it didn’t work ofcourse:

Route::group('admin', function()
{
    Route::get('something', array('uses' => 'mycontroller@index'));
    Route::get('another', array('uses' => 'mycontroller@second'));
    Route::get('foo', array('uses' => 'mycontroller@bar'));
});

Corresponding to these routes:

admin/something
admin/another
admin/foo

I can ofcourse just prefix all those routes directly with admin/, but I’d like to know if it’s possible to do it my way.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T12:23:34+00:00Added an answer on June 11, 2026 at 12:23 pm

    Unfortunately no. Route groups were not designed to work like that. This is taken from the Laravel docs.

    Route groups allow you to attach a set of attributes to a group of routes, allowing you to keep your code neat and tidy.

    A route group is used for applying one or more filters to a group of routes. What you’re looking for is bundles!

    Introducing Bundles!

    Bundles are what you’re after, by the looks of things. Create a new bundle called ‘admin’ in your bundles directory and register it in your application/bundles.php file as something like this:

    'admin' => array(
        'handles' => 'admin'
    )
    

    The handles key allows you to change what URI the bundle will respond to. So in this case any calls to admin will be run through that bundle. Then in your new bundle create a routes.php file and you can register the handler using the (:bundle) placeholder.

    // Inside your bundles routes.php file.
    Route::get('(:bundle)', function()
    {
        return 'This is the admin home page.';
    });
    
    Route::get('(:bundle)/users', function()
    {
        return 'This responds to yoursite.com/admin/users';
    });
    

    Hope that gives you some ideas.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there way to set @include mixin(); to variable? I tried this @mixin bg-gradient($fallback,
Is there way to get file from windows xp command prompt? I tried to
is there way how to get name ov event from Lambda expression like with
Is there a way to shutdown Eclipse cleanly from the command line, such that
I have an order by linq query, something like this like this: var sortedList
This is surely obvious but I'm stuck on it. I want to have something
Is there some way in Python to capture KeyboardInterrupt event without putting all the
I'd like to have a group of table entries using the collapse setting but
Is there a way to cleanly terminate a message loop issued by calling System.Windows.Forms.Application.Run()
Is there any way to run this sql query in Doctrine using symfony ??

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.