@component('mail::message') {{-- Greeting --}} @if (! empty($greeting)) # {{ $greeting }} @else @if ($level == 'error') # Whoops! @else {{-- # Hello, {{ $user->full_name }}! --}} @endif @endif {{-- Intro Lines --}} @foreach ($introLines as $line) {!! $line !!} @endforeach {{-- Action Button --}} @isset($actionText) @component('mail::button', ['url' => $actionUrl, 'color' => $color]) {{ $actionText }} @endcomponent @endisset {{-- Table --}} @isset($table_headings) @component('mail::table') | {{ $table_headings->implode('|') }} | | {{ $table_headings->map(function(){return ':---';})->implode('|') }} | @foreach($table_body as $row) | {!! $table_headings->map(function($heading, $attr)use($row){ $attrs = explode('.', $attr); $data = $row; foreach ($attrs as $att) { if (is_array($data)) { if(is_array(current($data))) $data = array_map(function($item)use($att){ return $item[$att];}, $data); elseif (current($data) instanceof Illuminate\Database\Eloquent\Collection) $data = array_map(function($item)use($att){ return $item->$att;}, $data); else $data = $data[$att]; } elseif ($data instanceof Illuminate\Support\Collection) { if(is_array($data[0])) $data = $data->map(function($item)use($att){return $item[$att];}); else $data = $data->map(function($item)use($att){return $item->$att;}); } else { $data = $data->$att; } } return collect($data ?? ' ')->implode("
"); })->implode('|') !!} | @endforeach @endcomponent @endisset {{-- Outro Lines --}} @foreach ($outroLines as $line) {{ $line }} @endforeach {{-- Salutation --}} @if (! empty($salutation)) {{ $salutation }} @else Regards,
{{ config('app.name') }} @endif {{-- Subcopy --}} @isset($actionText) @component('mail::subcopy') If you’re having trouble clicking the "{{ $actionText }}" button, copy and paste the URL below into your web browser: [{{ $actionUrl }}]({{ $actionUrl }}) @endcomponent @endisset @endcomponent