@foreach($posts as $post) @php $author = $post->author()->first(); $authorPhoto = $author->profile_photo_url; $image = Storage::url($post->image); $blogPostViewsCount = views($post)->unique()->count(); $type = Str::afterLast($post->getMorphClass(), 'Models\\'); $postShowRoute = route(Str::snake($type) . ".show", $post->id); @endphp
@if($type == "Recipe")
139.9 ккал
{{ $post->cooking_time }}
{{ $post->steps->count() }} этапов
@endif {!! $post->description !!}
{{ $blogPostViewsCount }} @if($type == "BlogPost") @endif
@endforeach {{-- $blogPosts->links() --}}