@extends('layouts.app') @section('title', "Home - Saad's Blog") @section('content')
@if(session('success'))
{{ session('success') }}
@endif @auth
{{ auth()->user()->name }}

Welcome back to Saad's Blog

View Profile
@csrf
What’s on your mind?
@csrf
Recent Posts
@forelse($posts as $post)
{{-- صورة المستخدم --}}
@if($post->user->avatar) {{ $post->user->name }} @else user->name }}" class="rounded-circle border" width="50" height="50" style="object-fit: cover;" > @endif
{{-- محتوى البوست --}}
{{ $post->title }}

by {{ $post->user->name }} • {{ $post->created_at->diffForHumans() }}

{{ \Illuminate\Support\Str::limit($post->content, 220) }}

{{-- سطر الكومنتات: ليبل بيضاوي + عدد الكومنتات --}}
{{-- عدد الكومنتات --}} {{ $post->comments_count ?? $post->comments->count() }} comments {{-- زر/ليبل الكومنت (يفتح الفورم تحت) --}} {{-- لو حابب تخلي العنوان يفتح صفحة البوست برضه --}} View Post
{{-- فورم الكومنت المخفي لكل بوست --}}
@csrf
@error('body')
{{ $message }}
@enderror
@empty

No posts have been published yet.

@endforelse
@else {{-- الزائر غير المسجل --}}

Welcome to Saad's Blog

Login or register to create posts and join the conversation.

Recent Posts
@forelse($posts as $post)
{{-- صورة المستخدم --}}
@if($post->user->avatar) {{ $post->user->name }} @else user->name }}" class="rounded-circle border" width="50" height="50" style="object-fit: cover;" > @endif
{{-- محتوى البوست --}}
{{ $post->title }}

by {{ $post->user->name }} • {{ $post->created_at->diffForHumans() }}

{{ \Illuminate\Support\Str::limit($post->content, 220) }}

{{ $post->comments_count ?? $post->comments->count() }} comments {{-- لو الزائر مش عامل لوجين، خليه يروح على اللوجين لما يضغط Comment --}} Comment
@empty

No posts have been published yet.

@endforelse
@endauth
@endsection