@props(['post', 'comments'])
{{-- HEADER POST --}} {{-- si je suis sur la page avec la route post.show , ne pas afficher le header --}} @if (Route::currentRouteName() !== 'post.show')
{{ $post->user->name }}

{{ $post->created_at }}

@if ($post->user_id !== Auth::id() && Route::currentRouteName() !== 'user.index')
@if ($post->is_followed)
@csrf @method('DELETE') {{ __('ne plus suivre') }}
@else
@csrf {{ __('suivre') }}
@endif
@endif {{ __('profil') }} {{ __('voir plus') }} @if (Auth::id() === $post->user_id)
@csrf {{ __('modifier') }}
@csrf @method('DELETE') {{ __('supprimer') }}
@endif
@endif {{-- BODY POST --}}
@if ($post->img_path) @endif

{{ $post->title }}

{{ $post->content }}

{{-- FOOTER POST --}}
@csrf @if ($post->is_liked) Disliker @else Liker @endif
{{ $post->likes_count }} J'aime
{{-- si la route est differente de post.show , ne pas afficher les commentaire --}} @if (Route::currentRouteName() === 'post.show')
@forelse ($post->comments as $comment)
{{ $comment->user->name }}

{{ $comment->content }}

{{-- MENU DEROULANT --}} {{ __('profil') }}
@if (Auth::id() === $comment->user_id) {{ __('modifier') }}
@csrf @method('DELETE') {{ __('supprimer') }}
@endif
{{-- FIN MENU DEROULANT --}}
@empty

Aucun commentaire

@endforelse
@csrf Commenter
@endif