I am beginner php developer. I have small problem with routing. I use this component on my website: spatie/laravel-permission
and I have this route:
Route::group(['prefix' => '', 'middleware' => ['role:superadmin, admin, seller, telemarketer']], function () {
Route::get('/', 'HomeController@index')->name('cms.home');
Route::resource('pages', 'PageController')->only(['index', 'create', 'store', 'edit', 'update', 'destroy']);
Route::get('/pages/dataTable', 'PageController@dataTable')->name('pages.dataTable');
});
I have problem with middleware. When I have this: ['role:superadmin, admin, seller, telemarketer']] I have error: InvalidArgumentException Auth guard [ admin] is not defined.
My user has 'superadmin' role.
When I make this code: ['role:superadmin']] - it's work fine.
How can I repair it to other my role??
Please help me
['role:superadmin,admin,seller,telemarketer']