Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

untymage's avatar

How to register specific route file?

In RouteServiceProvider i add a method for my route file for admin section :

    protected function mapAdminRoutes()
    {
        Route::middleware('web')
            ->namespace($this->namespace)
            ->group(base_path('routes/admin.php'));
    }

routes/admin.php

Route::post('admin/threads', 'ThreadController@store');

But i'm getting NotFoundHttpException any idea?

0 likes
2 replies
Snapey's avatar
Snapey
Best Answer
Level 122

did you add your new function to the map() method in RouteServiceProvider ?

Please or to participate in this conversation.