@if(auth()->user()->role === 'user') @endif
{{-- Notifications désactivées temporairement --}} {{--
Notifications
@forelse([] as $notification) @php // Déterminer le contexte (entreprise/franchise) selon le type de notification $ticketId = null; $contextLogo = asset('assets/Logo_reduit.png'); $contextName = ''; $contextType = ''; // Cas: notifications liées aux tickets if (strpos($notification->url, '/support/ticket/') !== false) { $ticketId = basename($notification->url); $ticket = \App\Models\Ticket::find($ticketId); if ($ticket) { if ($ticket->company) { $contextLogo = $ticket->company->logo ? asset('storage/' . $ticket->company->logo) : asset('assets/Logo_reduit.png'); $contextName = $ticket->company->name; $contextType = 'Entreprise'; } elseif ($ticket->franchise) { $contextLogo = $ticket->franchise->logo ? asset('storage/' . $ticket->franchise->logo) : asset('assets/Logo_reduit.png'); $contextName = $ticket->franchise->name; $contextType = 'Franchise'; } } } // Cas: notifications d'invitation franchise if (in_array($notification->type, ['invitation_franchise', 'invitation_owner_franchise'])) { $franchiseId = $notification->data['franchise_id'] ?? null; if ($franchiseId) { $franchise = \App\Models\Franchise::find($franchiseId); if ($franchise) { $contextLogo = $franchise->logo ? asset('storage/' . $franchise->logo) : asset('assets/Logo_reduit.png'); $contextName = $franchise->name; $contextType = 'Franchise'; } } } // Cas: notifications d'invitation entreprise if (in_array($notification->type, ['invitation_company', 'invitation_owner_company'])) { $companyId = $notification->data['company_id'] ?? null; if ($companyId) { $company = \App\Models\Company::find($companyId); if ($company) { $contextLogo = $company->logo ? asset('storage/' . $company->logo) : asset('assets/Logo_reduit.png'); $contextName = $company->name; $contextType = 'Entreprise'; } } } @endphp @if(in_array($notification->type, ['invitation_franchise', 'invitation_owner_franchise', 'invitation_company', 'invitation_owner_company']))
@if(!$notification->read)
@endif
@if($contextLogo && $contextLogo !== '/assets/logo.png')
{{ $contextName }}
@else
@endif
Invitation à rejoindre
{{ $contextName }}
{{ $notification->message }}
{{ $notification->created_at->diffForHumans() }}
@else
@if(!$notification->read)
@endif
{{ $notification->title }}
{{ $notification->created_at->diffForHumans() }}
{{ Str::limit($notification->message, 85) }}
@if($contextName)
{{ $contextType }} {{ $contextName }}
@endif
@endif @empty
Aucune notification
@endforelse
--}} {{-- TODO: Ajouter les routes support.create et support.contact @if(auth()->user()->role === 'user') @endif --}}
@yield('content')