{{-- * LaraClassifier - Classified Ads Web Application * Copyright (c) BeDigit. All Rights Reserved * * Website: https://laraclassifier.com * Author: Mayeul Akpovi (BeDigit - https://bedigit.com) * * LICENSE * ------- * This software is furnished under a license and may be used and copied * only in accordance with the terms of such license and with the inclusion * of the above copyright notice. If you Purchased from CodeCanyon, * Please read the full License from here - https://codecanyon.net/licenses/standard --}} @extends('layouts.master') @php $apiResult ??= []; $posts = (array)data_get($apiResult, 'data'); $totalPosts = (int)data_get($apiResult, 'meta.total', 0); $pagePath ??= null; $pageTitles = [ 'list' => [ 'icon' => 'fa-solid fa-bullhorn', 'title' => t('my_listings'), ], 'archived' => [ 'icon' => 'fa-solid fa-calendar-xmark', 'title' => t('archived_listings'), ], 'favourite' => [ 'icon' => 'fa-solid fa-bookmark', 'title' => t('favourite_listings'), ], 'pending-approval' => [ 'icon' => 'fa-solid fa-hourglass-half', 'title' => t('pending_approval'), ], ]; @endphp @section('content') @includeFirst([config('larapen.core.customizedViewPath') . 'common.spacer', 'common.spacer'])
@if (session()->has('flash_notification'))
@include('flash::message')
@endif
@includeFirst([config('larapen.core.customizedViewPath') . 'account.inc.sidebar', 'account.inc.sidebar'])

{{ $pageTitles[$pagePath]['title'] ?? t('posts') }}

{!! csrf_field() !!}
@if (!empty($posts) && $totalPosts > 0) @foreach($posts as $key => $post) @php $postUrl = \App\Services\UrlGen::post($post); $deletingUrl = url('account/posts/' . $pagePath . '/' . data_get($post, 'id') . '/delete'); $isEditingAllowed = ( in_array($pagePath, ['list', 'pending-approval']) && isset($authUser, $authUser->id) && $authUser->id == data_get($post, 'user_id') && empty(data_get($post, 'archived_at')) ); $isArchivingAllowed = ( $pagePath == 'list' && isVerifiedPost($post) && empty(data_get($post, 'archived_at')) ); $isRepostingAllowed = ( $pagePath == 'archived' && isset($authUser, $authUser->id) && $authUser->id == data_get($post, 'user_id') && !empty(data_get($post, 'archived_at')) ); $editingUrl = \App\Services\UrlGen::editPost($post); $archivingUrl = url('account/posts/' . $pagePath . '/' . data_get($post, 'id') . '/offline'); $repostingUrl = url('account/posts/' . $pagePath . '/' . data_get($post, 'id') . '/repost'); @endphp @endforeach @endif
{{ t('Photo') }} {{ t('listing_details') }} -- {{ t('Option') }}
img

{{ str(data_get($post, 'title'))->limit(40) }} @if (in_array($pagePath, ['list', 'archived', 'pending-approval'])) @if (!empty(data_get($post, 'payment')) && !empty(data_get($post, 'payment.package'))) @php if (data_get($post, 'featured') == 1) { $color = data_get($post, 'payment.package.ribbon'); $packageInfo = ''; } else { $color = '#ddd'; $packageInfo = ' (' . t('expired') . ')'; } @endphp @endif @endif

@php $listingDates = getListingDates($post, $pagePath); @endphp @if (!empty($listingDates)) @foreach($listingDates as $label => $labeledDate)

 {!! $labeledDate !!}

@endforeach @endif

{{ data_get($post, 'visits_formatted') ?? 0 }} {{ data_get($post, 'city.name') ?? '-' }}

{!! data_get($post, 'price_formatted') !!}
@if ($isEditingAllowed)

{{ t('Edit') }}

@endif @if ($isArchivingAllowed)

{{ t('Offline') }}

@endif @if ($isRepostingAllowed)

{{ t('Repost') }}

@endif

{{ t('Delete') }}

@endsection @section('after_styles') @endsection @section('after_scripts') {{-- include custom script for listings table [select all checkbox] --}} @endsection