post_show.blade.php 833 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. @extends ('layout')
  2. @section ('content')
  3. <div class='feed'>
  4. <div class='feedPost'>
  5. <h1>
  6. {{ $post['title'] }}
  7. </h1>
  8. <div class='postText'>
  9. {{ $post['text'] }}
  10. </div>
  11. <a href="{{ route('cntrl.edit', [$post['id']])}}">Edit</a>
  12. <form action="{{ route('cntrl.destroy', [$post['id']])}}" method='POST'>
  13. @method('delete')
  14. @csrf
  15. <input type='submit' value='Delete' />
  16. </form>
  17. </div>
  18. <div class='comments'>
  19. @foreach ($comments as $comment)
  20. <div>
  21. {{ $comment['text'] }}
  22. </div>
  23. @endforeach
  24. </div>
  25. <form action="{{ route('comment.store')}}" method='POST'>
  26. @method('post')
  27. @csrf
  28. <input type='hidden' name='post_id' value="{{$post['id']}}" />
  29. <textarea name='text'></textarea>
  30. <input type='submit' value='Submit' />
  31. </form>
  32. </div>
  33. @endsection
  34. @section ('title')
  35. create
  36. @endsection