A laravel package that enables each user to send emails through your app using their own unique email configuration.
- PHP 8.0+
- Laravel 9+
composer require ikechukwukalu/dynamicmailconfig
php artisan vendor:publish --tag=dmc-migrations
php artisan migrate
MAIL_FIELDS_HASH=true
use Illuminate\Support\Facades\Route;
Route::middleware(['dynamic.mail.config'])->group(function () {
Route::post('/', [\namespace\SomethingController::class, 'functionName']);
});
Route::post('/', [\namespace\SomethingController::class, 'functionName'])->middleware('dynamic.mail.config');
use Ikechukwukalu\Dynamicmailconfig\Models\UserEmailConfiguration;
protected $hidden = [
'name',
'address',
'driver',
'host',
'port',
'encryption',
'username',
'password'
];
The default mail configuration will be used if a user does not have a custom mail configuration in place.
php artisan vendor:publish --tag=dmc-config
The DMC package is an open-sourced software licensed under the MIT license.