php - Laravel - Using of yields / extends -


i have @include problem bootstrap navbar. worked on morning , don't know problem is.

here error message :

view [layouts.navbar] not found.

i want include content of navbar.blade.php

<!doctype html> <html> <head> <title>mana tournaments</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/> {!! html::style('css/style.css') !!} {!! html::style ('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css')  !!} {!! html::style ('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css') !!} </head> <body> <div class="container"> <nav class="navbar navbar-default navbar-fixed-top">     <div class="container-fluid">         <div class="navbar-header">             <a class="navbar-brand" href="#">logo</a>         </div>         <ul class="nav navbar-nav">             <li class="active"><a href="welcome">accueil</a></li>             <li><a href="#">tournois</a></li>             <li><a href="#">inscription</a></li>             <li><a href="#">contact</a></li>         </ul>     </div> </nav> </div> </body> </html> 

to index page (welcome.blade.php)

<!doctype html> <html>     <head>     <title>mana tournaments</title>     <meta http-equiv="content-type" content="text/html; charset=utf-8"/>     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>     {!! html::style('css/style.css') !!}     {!! html::style ('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css')  !!}     {!! html::style ('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css') !!}     </head> <body> <h1>gestionnaire de tournois</h1> <div class="container">  @include('layouts.navbar')  </div>  </body> </html> 

i created manually layout folder, created navbar file. if did someting wrong, maybe there's command line laravel creating folder ?

thank helping me on problem.

first of all,

make sure view you're including exists in correct folder.

@include('layouts.navbar') include path \resources\views\layouts\navbar.blade.php

make sure, file within layouts directory,

second, don't need write whole html included part. navbar.blade.php added (included) welcome.blade.php, it's you're copying content of navbar.blade.php , adding welcome.blade.php,

so make instead,

navbar.blade.php

<nav class="navbar navbar-default navbar-fixed-top">     <div class="container-fluid">         <div class="navbar-header">             <a class="navbar-brand" href="#">logo</a>         </div>         <ul class="nav navbar-nav">             <li class="active"><a href="welcome">accueil</a></li>             <li><a href="#">tournois</a></li>             <li><a href="#">inscription</a></li>             <li><a href="#">contact</a></li>         </ul>     </div> </nav> 

Comments