I am facing a problem in the menu bar which doesn't show result correctly. I am sharing a few lines.
index.blade.php: -
<nav class="navbar navbar-expand-lg navbar-light">
<a class="navbar-brand" href="">Easy Service</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item ">
<a class="nav-link" href="">Home </a>
</li>
<li class="nav-item">
<a class="nav-link" href="about">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="services">Services</a>
</li>
<li class="nav-item">
<a class="nav-link " href="contact">Contact</a>
</li>
<li class="es">
<a href="#" class="nav-link" data-toggle="modal" data-target="#myModal">Login</a>
</li>
</ul>
</nav>
Here is another file.
web.php
<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/', function () {
return view('index');
});
Route::get('/about', function () {
return view('about');
});
Route::get('/contact', function () {
return view('contact');
});
Route::get('/services', function () {
return view('services');
});
When I open up the pages from the home page by clicking the links, the output is correct but when I open up the links through other pages then home page link is not working.
If I put (/index)
in web.php file, then it worked, but I don't want to show my home page link in URL with (/index)
.
It is only by opening with showing the name with URL after a slash (/).
How can I link home page without showing URL on the browser?