laravel email notification problem send value with queue

  laravel

i use this code for send users name and email in text for email notifications but when emails send, user informations not show in email body

    @php
$text = $setting['user_change_type'];
@endphp
@php
    $text = str_replace(['%name%'],[IlluminateSupportFacadesAuth::user()->name],$text);
    $text = str_replace(['%email%'],[IlluminateSupportFacadesAuth::user()->email],$text);
    $text = str_replace(['%role%'],[IlluminateSupportFacadesAuth::user()->role],$text);
    $text = str_replace(['%title%'],[$setting['title']],$text);
@endphp
@component('mail::message')
{!! $text !!}
@component('mail::button', ['url' => url('/')])
Login to website
@endcomponent
@endcomponent

Source: Laravel

Leave a Reply