I am experiencing a problem where the code works but sometimes it fails to display the proper info in the outermost @component; the logo it shows is wrong, like if it's caching the outermost layout and using it on the next call, but with outdated info
The issue happens while sending emails, which are run on queues.
The relevant part of the code is as follows:
1: the mail I'm trying to send (works 100% of the time) markdown.blade.php
@component('mail::message')
# @lang('emails.bookingRequestReceipt', ['user' => $association->person->account->first_name, 'school' => $bookingRequest->school->name])
{!! html_entity_decode($custom_intro) ?? '' !!}
@endcomponent
2: the message component (works 100% of the time)
@component('mail::layout')
<!-- THIS IS THE RELEVANT PART -->
{{-- Header --}}
@slot('header')
@component('mail::header', ['url' => $school['url'] ?? config('app.url')])
@if(!empty($school['logo']) && !$school['logo']['default'])
<img src="{{ $school['logo']['url'] }}" class="logo" alt="{{ $school['logo']['alt'] }}" />
@elseif(empty($school))
<img src="https://[redacted]/public/img/logo.png" class="logo" alt="{{ config('app.name') }}" />
@else
{{ $school->name }}
@endif
@endcomponent
@endslot
<!-- END OF RELEVANT PART -->
{{-- Body --}}
{{ $slot }}
@endcomponent
3: the layout (fails)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<table class="wrapper" width="100%" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td align="center">
<table class="content" width="100%" cellpadding="0" cellspacing="0" role="presentation">
<!-- THIS IS THE RELEVANT PART -->
{{ $header ?? '' }}
<!-- END OF RELEVANT PART -->
<!-- Email Body -->
<tr>
<td class="body" width="100%" cellpadding="0" cellspacing="0">
<table class="inner-body" align="center" width="570" cellpadding="0" cellspacing="0" role="presentation">
<!-- Body content -->
<tr>
<td class="content-cell">
{{ Illuminate\Mail\Markdown::parse($slot) }}
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
Any idea what I'm doing wrong? The informations regarding the $school inside the message are always correct
Is it beacause I haven' used php artisan make:component to create the layout?
EDIT: removed leftover code