I'm doing a project that the tutorial that I'm learning from, has not the same LARAVEL version as the mine. so it keeps routing the controllers with dots but doesn't make any changes to the routing page codes. like setting or changing the rout name or something like that and for that version it worked fine. but in my project, server can't recognize that kind of routing. how should i change the routes to work correctly?
i know for those kind of routes that we add them we can set a name for them to find the route correctly
but I need to set the /home route in a way that will work fine but it doesn't matter where do i add the dot in the name of route, .home or home. , it won't work!
here is my web.php code:
Route::get('/home', 'HomeController@index')->name('home');
and my controller:
public function index()
{
return View('index.index');
}
localhost:8000/home works fine but i need to fix localhost:8000 routing to be recogniz
it's unclear what you're asking.
You've made an url for
/homewhich is namedhome. This means that in your blade templates, you can call<a href="{{ route('home') }}">The dot can be used as a separation symbol, Naming the route
home.indexusually means: home controller, index method. It can be whatever you like though.So you likely want to change the route name to
->name('home.index')You could then access that using
route('home.index')