welcome.blade.php:
@extends('layouts.app')
@section('content')
@yield('posts')
@endsection
posts.blade.php:
@extends('welcome')
@section('posts')
asfdsfdsf
@endsection
Both files are in the same folder outside of the layouts folder. What am i doing wrong?
A lot of depends what you have in your app.blade.php
. If you have:
@yield('content')
then you should have displayed asfdsfdsf
without any problem.
EDIT
Full working example:
In controller:
return view('test.posts');
resources/views/test/posts.blade.php:
@extends('test.welcome')
@section('posts')
asfdsfdsf
@stop
resources/views/test/welcome.blade.php
@extends('layouts.app')
@section('content')
@yield('posts')
@stop
resources/views/layouts/app.blade.php
@yield('content')
Result is:
asfdsfdsf
as expected
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