{{ $data }}
@if($show == 'true')
{{ $title }}
@endif
@php parse_str($data, $module); $entityId = (isset($module['entityId']) && is_numeric($module['entityId'])) ? $module['entityId'] : 0; $quantity = (isset($module['quantity']) && is_numeric($module['quantity'])) ? (int)$module['quantity'] : 5; $serverID = session('serverID'); $conn = $serverID ? DB::connection('mysql_site_' . $serverID) : null; $news = []; $catName = ''; if ($conn) { if ($entityId > 0) { $categorie = $conn->table('posts_categories')->where('id', $entityId)->first(); $catName = $categorie ? $categorie->name : ''; } $query = $conn->table('posts as p')->select('p.*')->where('p.site_id', $siteID)->where('p.status', '1'); if ($entityId > 0) { $query->join('post_category as pc', 'pc.post_id', '=', 'p.id')->where('pc.category_id', $entityId); } $news = $query->groupBy('p.id')->orderBy('p.id', 'DESC')->limit($quantity)->get(); } @endphp @if(empty($news) || count($news) == 0)
Nenhuma notícia cadastrada
@else @foreach($news as $new)
{{ $new->title }}
@if($catName != '')
{{ $catName }}
@endif
{{ mb_strimwidth($new->title, 0, 125, "...") }}
{{ date('d/m/Y H:i', strtotime($new->created_at)) }}
@endforeach
Ver todas as notícias @endif