@if(session('success'))
{{ session('success') }}
@endif
@if($posts->count() > 0)
@foreach($posts as $post)
{{ $post->title }}
@if($post->user_id !== auth()->id())
автор: {{ $post->user->name }}
@endif
{{ Str::limit($post->content, 100) }}
{{ $post->created_at->diffForHumans() }}
@can('update-post', $post)
Edit
@endcan
@can('delete-post', $post)
@endcan
@endforeach
{{ $posts->links() }}
@else
No posts found.
@endif