@php $tenant = auth()->user()->tenant; $reportKey = $report; $endpointMap = [ 'sources' => url('/api/reports/sources'), 'agents' => url('/api/reports/agents'), 'funnel' => url('/api/reports/funnel'), 'conversations' => url('/api/reports/conversations'), 'lost-reasons' => url('/api/reports/lost-reasons'), ]; $reportLinks = [ ['key' => 'sources', 'label' => 'Sources', 'url' => route('reports.show', 'sources')], ['key' => 'agents', 'label' => 'Agents', 'url' => route('reports.show', 'agents')], ['key' => 'funnel', 'label' => 'Funnel', 'url' => route('reports.show', 'funnel')], ['key' => 'conversations', 'label' => 'Conversations', 'url' => route('reports.show', 'conversations')], ['key' => 'lost-reasons', 'label' => 'Lost Reasons', 'url' => route('reports.show', 'lost-reasons')], ]; $reportsData = [ 'companyName' => $tenant->company_name, 'reportKey' => $reportKey, 'endpoint' => $endpointMap[$reportKey], 'links' => $reportLinks, ]; @endphp