@extends('layouts.app') @section('title', 'Posts') @section('content')
@if(count($posts)>0)
@foreach($posts as $post)
{{is_null($post->category_id)?"Uncategorized":$post->category->name}}

{{$post->getTranslatedAttribute('title')}}

{{Str::words($post->getTranslatedAttribute('excerpt'),10)}}

{{$post->created_at->diffForhumans()}}

@endforeach
@else No items to show @endif
{{$posts->links()}}
@if (count($featured_posts)>0)

Featured


@foreach ($featured_posts as $post)

{{$post->getTranslatedAttribute('title')}}

{{Str::words($post->getTranslatedAttribute('excerpt'),10)}} Read More

By {{ is_null($post->authorId)?'Admin':$post->authorId->name }}

{{$post->created_at->diffForhumans()}}

@endforeach
@endif
@endsection