LetMeKnow
1 week ago

what is different middleware(['auth:sanctum']) with middleware group

Posted 1 week ago by LetMeKnow

Hai guys,

when im install jetstream , im got a code in web.php like this

Route::middleware(['auth:sanctum', 'verified'])->get('/dashboard', function () {
    return view('dashboard');
})->name('dashboard');

usually im using route::group

how i can implementation route from jetstream like route::group

example

Route::middleware(['auth:sanctum', 'verified'])->get('/dashboard', function () {
Route::resource('/category', 'CategoryController');
Route::resource('/tag', 'TagsController');
Route::get('/post/hapus', '[email protected]_hapus')->name('post.tampil.hapus');
Route::get('/post/restore/{id}', '[email protected]')->name('post.restore');
Route::delete('/post/kill/{id}', '[email protected]')->name('post.kill');
Route::resource('/post', 'PostController');
    return view('dashboard');
})->name('dashboard');

Please sign in or create an account to participate in this conversation.