@extends('site.layouts.new.app') @php $latestDocumentItems = collect($latestDocuments ?? [])->take(2)->map(function ($item, $index) { $title = trim((string) ($item->document_type->name ?? 'Documento')); if (!empty($item->number) && $item->number !== '0') { $title .= ' ' . $item->number; if (!empty($item->date)) { try { $title .= '/' . $item->getYear($item->date); } catch (\Throwable $exception) { } } } return [ 'title' => $title, 'subtitle' => $item->owner->short_name ?? ($item->user->name ?? 'Responsável não informado'), 'date' => $item->date ?? '-', 'tone' => $index === 0 ? 'is-blue' : 'is-amber', 'href' => route('DocumentDetailsFront', ['id' => $item->id, 'documents' => 'true', 'front_layout' => 'new']), ]; }); $latestLawProjectItems = collect($latestLawProjects ?? [])->take(2)->map(function ($item, $index) { $title = trim((string) ($item->law_type->name ?? 'Projeto de Lei')); if (!empty($item->project_number) && $item->project_number !== '0') { $title .= ' ' . $item->project_number; if (!empty($item->law_date)) { try { $title .= '/' . $item->getYearLawPublish($item->law_date); } catch (\Throwable $exception) { } } } return [ 'title' => $title, 'subtitle' => $item->assemblyman->short_name ?? 'Responsável não informado', 'date' => $item->law_date ?? '-', 'tone' => $index === 0 ? 'is-blue' : 'is-amber', 'href' => route('LawsDetailsFront', ['id' => $item->id]) . '?projects=true&front_layout=new', ]; }); $latestItems = $latestDocumentItems ->concat($latestLawProjectItems) ->take(4) ->values(); $sessionItems = collect($upcomingMeetings ?? [])->take(3)->map(function ($item) { $formattedDate = '-'; if (!empty($item->date_start)) { try { $formattedDate = \Carbon\Carbon::createFromFormat('d/m/Y H:i', $item->date_start)->format('d/m/Y'); } catch (\Throwable $exception) { try { $formattedDate = \Carbon\Carbon::parse($item->date_start)->format('d/m/Y'); } catch (\Throwable $exception) { $formattedDate = (string) $item->date_start; } } } return [ 'title' => trim(($item->sessionType->name ?? 'Sessão') . ' ' . ($item->number ?? '-')), 'subtitle' => $item->sessionType->name ?? 'Sessão', 'date' => $formattedDate, 'tone' => 'is-blue', 'href' => route('site.propositions', ['id' => $item->id, 'front_layout' => 'new']), ]; })->values(); $documentTypeChartItems = collect($documentTypeChartItems ?? [])->values(); @endphp @section('site_content')
Nenhum documento encontrado para montar o ranking no momento.
Nenhuma sessão agendada no momento.