Stand Out with a Custom Mail Logo in Laravel

 How to change default Mail logo in Laravel

Change Default Mail Logo - Laravel

In this article we will learn how to change default logo in Laravel mail . We just need to publish our vendor for mail in our resources folder . So let's see how to do this with an example .

Laravel Default Mail :

Change Default Mail Logo - Laravel

Step 1 - Run the following command :

So the first step is to publish our Mail components inside our resource folder so that we can change the default configuration , to do that just run  the following command and it will create a folder named vendor inside your app/resources/views .

php artisan vendor:publish --tag=laravel-mail

Change Default Mail Logo - Laravel

Now this command will create a vendor folder inside your app/resources/views directory .

Step 2 - Change default logo :

That's it now simply navigate to app/resources/views/vendor/mail/html/message.blade.php as shown below .

Change Default Mail Logo - Laravel

message.blade.php :

Now in this file you can change your header and footer , you just have to provide the image path inside the header section and you can also change the footer text according to you in the footer section as shown below .

{{-- Header --}}
@component('mail::header', ['url' => config('app.url')])
{{-- {{ config('') }} --}}

<img src="{{asset('storage/logo/logo.jpg')}}" style="height: 75px;width: 75px;">


{{-- Body --}}
{{ $slot }}

{{-- Subcopy --}}
{{ $subcopy }}

{{-- Footer --}}
© {{ date('Y') }} {{ config('') }}. @lang('All rights reserved.')

Step 3 - Check your Mail template :

Change Default Mail Logo - Laravel

Previous Post Next Post

Contact Form