Answer the question
In order to leave comments, you need to log in
How to add a route to the admin panel?
Good afternoon, ladies and gentlemen.
There is an admin panel
It has the following group implementation
Route::group(['prefix' => 'admin'], function () {
Voyager::routes();
});
Route::get('/admin/needfixfilter', function () {
return view('needfixfilter');
});
Answer the question
In order to leave comments, you need to log in
Attach a middleware to the desired route / group of routes, in which the authorization check will take place.
Docks, read the docks!
https://the-control-group.github.io/voyager/docs/0...
And also look at the implementation of the package itself:
vendor/tcg/voyager/src/Http/Middleware/VoyagerAdminMiddleware.php
vendor/tcg/ voyager/routes/voyager.php
As you can see, admin routes are stored in a group:
Route::group(['middleware' => 'admin.user'], function() {
});
Voyager::canOrFail('edit_menus');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question