Overriding rydurham/sentinel route paths in Laravel 5

636 Views Asked by At

I am using the rydurhmam/sentinel package in Laravel 5.0.x and I cannot change how the default mysite.com/profile route is handled.

In my routes.php file I have declared Route::resource('profile', 'ProfileController');

When I call php artisan route:list I get:

| GET|HEAD | profile                | sentinel.profile.show | Sentinel\Controllers\ProfileController@show    | sentry.auth  |
| GET|HEAD | profile/create         | profile.create        | App\Http\Controllers\ProfileController@create  | sentry.auth  |
| POST     | profile                | profile.store         | App\Http\Controllers\ProfileController@store   | sentry.auth  |
| GET|HEAD | profile/{profile}      | profile.show          | App\Http\Controllers\ProfileController@show    | sentry.auth  |
| GET|HEAD | profile/{profile}/edit | profile.edit          | App\Http\Controllers\ProfileController@edit    | sentry.auth  |
| PUT      | profile/{profile}      | profile.update        | App\Http\Controllers\ProfileController@update  | sentry.auth  |
| PATCH    | profile/{profile}      |                       | App\Http\Controllers\ProfileController@update  | sentry.auth  |
| DELETE   | profile/{profile}      | profile.destroy       | App\Http\Controllers\ProfileController@destroy | sentry.auth  |

And you'll notice the first profile route is handled by the Sentinel Controller found within the vendor package file.

The sentinel config file only allows you to turn off routing in its entirety, so is there anyway to override selected controllers or am I SOL?

1

There are 1 best solutions below

2
On BEST ANSWER

Try this: In config/sentinel.php

  'routes_enabled' => false,

in your routes.php

include(dirname(with(new ReflectionClass('Sentinel\SentinelServiceProvider'))->getFileName()) . '/../routes.php');

and declare your routes as normal in routes.php file after include and that should work fine.

let me know.