-3

This one works fine which is found in my pages folder in the view folder

@extends('layouts.app')
@section('content')
    <h2>This is an awesome application. My about page.</h2>
    <p>It is very awesome that I am coding it with laravel</p>
@endsection

I had to use @include rather than @extend. This worked after it was pointed out to use @include.

While this one doesn't which is found in my post folder in the view folder

@include('layouts.app')
@section('content')
    <a href="/posts" class="btn btn-default">Go Back</a>
    <h1>{{ $post->title}}</h1>
    <p>{{ $post->body}}</p>
    <small>{{ $post->created_at }}</small>
@endsection

1 Answers1

0

Instead of @include use @extends

Also try closing your <p> tag with </p> and <small> tag with </small>

@extends('layouts.app')
@section('content')
    <a href="/posts" class="btn btn-default">Go Back</a>
    <h1>{{ $post->title}}</h1>
    <p>{{ $post->body}}</p>
    <small>{{ $post->created_at }}</small>
@endsection
Saad Suri
  • 1,352
  • 1
  • 14
  • 26
Kattia
  • 303
  • 4
  • 13