PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, January 12, 2022

[FIXED] Routing Error - how to call same route with out any error

 January 12, 2022     laravel     No comments   

Issue

First Route

Route::get('/', [HomeController::class, 'method'])->name('home.index');

Second Route

Route::get('/{slug}', [Controller::class, 'method'])->name('view');

Third Route

Route::get('/dashboard', [HomeController::class, 'method'])->name('home');

how to call route with out any error??


Solution

So you have to order something like this,

Route::get('/', [HomeController::class, 'method'])->name('home.index');
Route::get('/dashboard', [HomeController::class, 'method'])->name('home');
Route::get('/{slug}', [Controller::class, 'method'])->name('view');

Let me know the results.



Answered By - Vivek Pawar
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing