mardi 24 juillet 2018

how to make working menu tab with laravel 5.4

I am working on Laravel 5.4 I have created a menu, in which three tabs Home, about and contact. When I click on Home then it should be on home page. When click on about, it should be on about page....

web.php:

<?php

Route::get('/', function()
{
return View('method1.home');
});
Route::get('about', function()
{
return View('method1.about');
});

**method1 is folder in resources\views**

home.blade.php:

@extends('method1.dashboard')
@section('content')
 <h1>This is home page</h1>
@endsection

about.blade.php is:

@extends('method1.dashboard')
@section('content')
 <h1>This is about page</h1>
@endsection

dashboard.blade.php is:

@include('method1.includes.menu-header')

menu-header.blade.php is:

<li class="active"> <a href="/">Home</a></li>
<li> <a href="/about">About</a></li>

But when I click on home or about page. It shows Page is not found.

My laravel projet folder name is admin_laravel. When I run http://localhost/admin_laravel/ then it shows home page and when run http://localhost/admin_laravel/about it shows about page.

But when I click on about menu button then in browser shows link http://localhost/about. Means it is not going with http://localhost/admin_laravel/about and page is not showing.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire