@extends('core::base.layouts.master') @section('title') {{ translate('Post') }} @endsection @section('custom_css') @include('core::base.includes.data_table.css') @endsection @section('main_content')

{{ translate('All Posts') }}

@can('Create Post') @endcan
{{-- Blog Filter Buttons --}} {{-- Blog Filter Buttons End --}}
@can('Delete Blog') @endcan @can('Edit Blog') @endcan @can('Manage Comment') @endcan @canany(['Edit Blog', 'Delete Blog']) @endcanany @php $key = 1; @endphp @foreach ($blogs as $blog) @can('Delete Blog') @endcan @can('Edit Blog') @endcan @can('Manage Comment') @endcan @canany(['Edit Blog', 'Delete Blog']) @endcanany @php $key++; @endphp @endforeach
{{ translate('Image') }} {{ translate('Name') }} {{ translate('Author') }} {{ translate('Category') }} {{ translate('Featured') }}{{ translate('Comment') }} {{ translate('Status') }} {{ translate('Actions') }}
{{ $blog->name }} @php $tlblog = Core\Models\TlBlog::where('id', $blog->id)->first(); $blog_name = $tlblog->translation('name', getLocale()); @endphp @if ($blog->is_publish == config('settings.blog_status.publish')) {{ strlen($blog_name) > 35 ? mb_substr($blog_name, 0, 35, 'UTF-8') . '...' : $blog_name }} @else {{ strlen($blog_name) > 35 ? mb_substr($blog_name, 0, 35, 'UTF-8') . '...' : $blog_name }} @endif — {{ $blog->visibility }} {{ $blog->user_name }} @if (isset($blog->category)) @foreach (getBlogCategory($blog->id) as $item) @php $cat = Core\Models\TlBlogCategory::where('id', $item)->first(); @endphp

{{ $cat->translation('name', getLocale()) }}

@endforeach @endif
{{ getCommentCount([['tl_blog_comments.blog_id', '=', $blog->id], ['tl_blog_comments.status', '=', '1']]) }} @if ($blog->is_publish == config('settings.blog_status.publish')) @if ($blog->publish_at > currentDateTime()) {{ translate('Schedule') }}
{{ date('d-m-Y h:m A', strtotime($blog->publish_at)) }} @else {{ translate('Published') }}
{{ date('d-m-Y h:m A', strtotime($blog->publish_at)) }} @endif
@elseif($blog->is_publish == config('settings.blog_status.pending')) {{ translate('Pending') }}
{{ translate('Last Modified') }}
{{ date('d-m-Y h:m A', strtotime($blog->publish_at)) }} @else {{ translate('Draft') }}
{{ translate('Last Modified') }}
{{ date('d-m-Y h:m A', strtotime($blog->publish_at)) }} @endif
@if (!(request()->input('page') && request()->input('page') > $blogs->lastPage())) {{-- pagination --}}
{{-- Blog Page Count Info --}}

{{ translate('Showing') }} @if (!request()->input('page') || request()->input('page') == 1) 1 to {{ count($blogs) }} @else @php if (request()->input('per_page')) { $per_page_count = request()->input('per_page'); } else { $per_page_count = 10; } $start_count = ((int) request()->input('page') - 1) * $per_page_count + 1; if (request()->input('page') == $blogs->lastPage()) { $end_count = $blogs->total(); } else { $end_count = (int) request()->input('page') * $per_page_count; } @endphp {{ $start_count . ' to ' . $end_count }} @endif {{ translate('items of') }} {{ $blogs->total() }}

@endif
@endsection @section('custom_scripts') @include('core::base.includes.data_table.script') @endsection