For some reason Laravel says the route 'posts.all' is not defined. here's my code:
html:
<li>
<a href="{{route('posts.all')}}" class=" waves-effect">
<i class="ri-calendar-2-line"></i>
<span>All Posts</span>
</a>
</li>
Laravel Controller group with middleware:
Route::middleware(['auth'])->name('dashboard')->group(function(){
Route::controller(\App\Http\Controllers\PostController::class)->group(function(){
Route::get('/dashboard', 'Dashboard')->name('dashboard');
Route::get('/posts/all', 'AllPosts')->name('posts.all');
});
});;
however, when i refactor the code to this, it works, but i want to keep in in the PostController
Route::get('/posts/all', [\App\Http\Controllers\PostController::class, 'AllPosts'])->name('posts.all');