How to change From Name in Laravel Mail Notification

In config/mail.php

set from property as:

'from' => ['address' => 'someemail@example.com', 'name' => 'Firstname Lastname']

Here, address should be the one that you want to display in from email and name should be the one what you want to display in from name.

P.S. This will be a default email setting for each email you send.

If you need to use the Name as a variable through code, you can also call the function from() as follows (copying from Brad Ahrens answer below which I think is good to mention here):

return $this
    ->from($address="noreply@example.com", $name="Sender name")
    ->subject('Here is my subject')
    ->view('emails.view');

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)