Vishnu M Raveendran
Vishnu M Raveendran

Reputation: 411

Route management issue Laravel 5.5

This is part of my routes/web.php file

if(Request::is('users/*'))
    {
        require __DIR__.'/users.php';
    }

I have a file named users.php under the same folder

Route::get('profile',[
    'middleware' => 'auth',
    'uses' =>'home\HomeController@profile'])->name('userprofile');

I'm trying to access users/profile route. But it is not working. Please help

Thanks in Advance

Upvotes: 0

Views: 63

Answers (1)

pedram afra
pedram afra

Reputation: 1213

Route::prefix('users')->group(function() {
    Route::get('profile', 'home\HomeController@profile')
         ->middleware('auth')->name('userprofile');
});

Upvotes: 2

Related Questions