37 lines
1.6 KiB
PHP
37 lines
1.6 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('content')
|
|
<div class="container">
|
|
<div class="row justify-content-center">
|
|
<div class="col-md-8">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
{{ $post->title }}
|
|
<div class="float-end">
|
|
@can('update-post', $post)
|
|
<a href="{{ route('posts.edit', $post) }}" class="btn btn-sm btn-primary">Edit</a>
|
|
@endcan
|
|
@can('delete-post', $post)
|
|
<form action="{{ route('posts.destroy', $post) }}" method="POST" class="d-inline">
|
|
@csrf
|
|
@method('DELETE')
|
|
<button type="submit" class="btn btn-sm btn-danger"
|
|
onclick="return confirm('Are you sure you want to delete this post?')">Delete</button>
|
|
</form>
|
|
@endcan
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card-body">
|
|
<p>{{ $post->content }}</p>
|
|
<hr>
|
|
<small>Created by: {{ $post->user->name }} on {{ $post->created_at->format('M d, Y') }}</small>
|
|
</div>
|
|
</div>
|
|
|
|
<a href="{{ route('home') }}" class="btn btn-secondary mt-3">Back to Posts</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection
|