I am having a problem using Laravel Framework 5.4.36 (on Visual studio code). I am trying to build a simple layout, but no mater how much I've tried I am getting the same error on my browser :
View [layouts.app] not found. (View: C:\wamp64\www\lsapp\resources\views\pages\services.blade.php)
as you can see (photo bellow) the file is deferentially there, in the right path.
Here is my code for my layout app.blade.php :
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{config('app.name','LSAPP')}}</title>
</head>
<body>
@yield('content')
</body>
and here is my code from services.blade.php
@extends('layouts.app')
@section('content')
<h1>services</h1>
<p>This is the services page</p>
@endsection
I have also installed Laravel Blade Snippets v 1.13.0 (1.14.1 was giving me another problem).
I have tried to change name and path both to the layout file and inside the extends parameter. Any ideas why this is not working?
Thank you very much in advance for your help..!
You must reference a blade template relative to the resources/views
directory. According to the screenshot your directory structure is:
resources
↳views
↳pages
↳layouts
app.blade.php
Therefore your app.blade.php
layout is available as pages.layouts.app
:
@extends('pages.layouts.app')
Change
@extends('layouts.app')
To
@extends('pages.layouts.app')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With