Published 5 months ago by SomeT
For the file located at:
\vendor\laravel\framework\src\Illuminate\Auth\Notifications\ResetPassword.php I believe this allows me to edit the default email sent for resetting password however I have two questions before I edit it.
If I update this locally will it cause any issues on my live deployment? I usually have vendor folder in my gitignore for deployment thus usual updates around this where I don't normally edit php files, are done within composer.lock and composer.json
Even if I did edit this file there are still two parts of the default email I want to change, the wording of Laravel at the top of the email and: 'Regards, Laravel' at the bottom, how would I even edit these because I can't see how in ResetPassword.php?
No! Don't ever edit anything in /vendor. Your changes will get overwritten with composer updates.
php artisan vendor:publish
If you have a very recent version of laravel, it will give you a menu of assets to publish. Look for one mentioning laravel mail and possibly laravel notifications. It will copy them to /resources/views/vendor where you can edit them safely and they will be included in your repo leaving /vendor pure. Laravel will look there first for views before using the ones in /vendor.
If it's an earlier version of laravel, it will publish everything available unless you specify which package to publish.
Edit: for your other questions, after you publish the assets, you will find a layout.blade.php for the emails. That's the master template and it includes a header and footer view (among others). You can edit those how you like.
It is not a good idea to edit anything in the vendor directory.
Instead, you can override the
sendPasswordResetNotification method on the User model, and specify the Mailable you wish to send.
Laravel header and signature are both based off of the
APP_NAME environment variable which you can set in the
I forgot to mention I have done
php artisan make:auth I am not sure if that makes a difference to your answer @Cronix ? From what you have indicated I need to do
php artisan vendor:publish on top of the already done
php artisan make:auth to create new templated files for my email reset templates in order for me to edit them outside vendor? Correct? This is what my views currently look like: https://gyazo.com/37d0d0d744e9177fe524b4d35dccbe50