I am getting above error while requesting to next page but I want posts title is as page title as well
@extends('layouts.app')
@section('pageTitle', $post->title)
@section('content')
<a href="{{ url('posts') }}" class="btn btn-outline-secondary">Go Back</a>
<br> <br>
<h1>{{ $post->title }}</h1>
<div class="">
<p>{!! $post->body !!}</p>
</div>
<hr>
<small>Written on: {{ $post->created_at }}</small>
<hr>
<a href="/posts/edit" class="btn btn-outline-primary">Edit</a>
@endsection
public function show($id)
{
$post = Post::find($id);
return view('posts.show')->with('post', $post);
}
{{$post['title']}}
– A.A Noman