skip to Main Content

How to user the prefix route name – Laravel

Route::middleware(['auth', 'role:admin'])->name('admin.')->prefix('admin')->group(function(){ Route::get('/role', [RoleController::class, 'index'])->name('index'); }); I want to user this route name. How I can? <li class="nav-item"> <a href="{{ url('admin/role') }}" class="nav-link"> <i class="far fa-circle nav-icon"></i> <p>Roles</p> </a> </li> user as url and it's working but I want to…

VIEW QUESTION

Laravel Route Can Not Find By Route Name

This is My Route Route::namespace("CoreControllerSite") ->prefix("/") ->name("site.") ->group(function () { Route::get("{slug}", "NewsController@index")->name("news.index"); Route::get("show/{slug}", "NewsController@show")->name("news.show"); Route::get("{slug}", "ArticleController@index")->name("article.index"); Route::get("show/{slug}", "ArticleController@show")->name("article.show"); Route::get("{slug}", "VideoController@index")->name("video.index"); }); This is My a href which is I used This Route <a href="{{ route('site.news.show', $item->slug) }}"></a> It gives Such…

VIEW QUESTION

Error with mapping out routes to controller classes in Laravel

I am having an issue when trying to define my routes to controller classes in Laravel. My web.php route looks like this: use AppHttpControllersFrontendArticlesController as FrontEndArticlesController; Route::get('/articles/{article:slug}', [FrontendArticlesController::class, 'show']); The controller looks like this: namespace AppHttpControllers; use AppModelsArticle; use IlluminateHttpRequest;…

VIEW QUESTION
Back To Top
Search