Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is modifying Laravel base config files a bad idea?

Tags:

laravel

Laravel comes with some basic config files available in config directory.
which each file is basically an associated array.
now, I want to change the structure of config/mail.php from

'from' => [
        'address' => env('MAIL_FROM_ADDRESS', '[email protected]'),
        'name' => env('MAIL_FROM_NAME', 'Example'),
],

to

'from' => [
    'noreply' => [
        'address' => env('MAIL_FROM_ADDRESS', '[email protected]'),
        'name' => env('MAIL_FROM_NAME', 'Example'),
    ]
],

so I can have several emails with differnt name.

My question is generic here.
What are(if any) disadvantages of modifying structure of the config files?
Is it possible to be troublesome between LTS upgrades?

like image 984
Mehrdad Shokri Avatar asked Dec 19 '25 09:12

Mehrdad Shokri


1 Answers

You shouldn't modify email.form data because Laravel uses the data:

You may specify a global from address in your config/mail.php configuration file. This address will be used if no other from address is specified within the mailable class

like image 81
Alexey Mezenin Avatar answered Dec 21 '25 08:12

Alexey Mezenin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!