I have installed a fresh copy of laravel 7.0 today and I am working with following routes and controllers
Routes
Route::get('/','DashboardController@dashboard');
Route::get('dashboard2','DashboardController@dashboard2');
Route::get('dashboard3','DashboardController@dashboard3');
DashboardController
class DashboardController extends Controller
{
public function dashboard(){
return view('dashboard.index');
}
public function dashboard2(){
return view('dashboard.index2');
}
public function dashboard3(){
return view('dashboard.index3');
}
}
All of these routes returns 404 not found except these one Route::get('/','DashboardController@dashboard');
Here I have discovered that the route having '/'
url only works fine because if I change dashboard2
url to '/'
it also works,
other routes are also working on Laravel Development server by php artisan serve
command. But I am not used to do so, Is there any solution?
route list
+--------+----------+------------+------+-----------------------------------------------------+---------
---+
| | GET|HEAD | | | App\Http\Controllers\DashboardController@dashboard | web
|
| | GET|HEAD | dashboard2 | | App\Http\Controllers\DashboardController@dashboard2 | web
|
| | GET|HEAD | dashboard3 | | App\Http\Controllers\DashboardController@dashboard3 | web
|
+--------+----------+------------+------+-----------------------------------------------------+---------
---+
I already cleared all caches like route, view, config etc