2023-03-17 14:33:48 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Foundation\Inspiring;
|
2023-05-23 11:32:11 +00:00
|
|
|
use Illuminate\Notifications\Messages\MailMessage;
|
2023-03-17 14:33:48 +00:00
|
|
|
use Illuminate\Support\Facades\Artisan;
|
2023-05-19 17:01:56 +00:00
|
|
|
use Symfony\Component\Mailer\Mailer;
|
2023-03-17 14:33:48 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Console Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| This file is where you may define all of your Closure based console
|
|
|
|
| commands. Each Closure is bound to a command instance allowing a
|
|
|
|
| simple approach to interacting with each command's IO methods.
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2023-05-19 17:01:56 +00:00
|
|
|
Artisan::command('inspire', function () {
|
|
|
|
|
|
|
|
$smtp = [
|
|
|
|
"transport" => "smtp",
|
|
|
|
"host" => "mailpit",
|
|
|
|
"port" => 1025,
|
|
|
|
"encryption" => 'tls',
|
|
|
|
"username" => null,
|
|
|
|
"password" => null,
|
|
|
|
"timeout" => null,
|
|
|
|
"local_domain" => null,
|
|
|
|
];
|
|
|
|
config()->set('mail.mailers.smtp', $smtp);
|
|
|
|
|
2023-05-23 11:32:11 +00:00
|
|
|
// For testing custom SMTP Mailer
|
|
|
|
\Illuminate\Support\Facades\Mail::mailer('smtp')
|
|
|
|
->to('ask@me.com')
|
|
|
|
->send(new \App\Mail\ExampleMail);
|
2023-05-19 17:01:56 +00:00
|
|
|
|
2023-05-23 11:32:11 +00:00
|
|
|
// For sending a notification
|
|
|
|
// \Illuminate\Support\Facades\Notification::send(
|
|
|
|
// \App\Models\User::find(1),
|
|
|
|
// new \App\Notifications\TestMessage
|
|
|
|
// );
|
2023-05-19 17:01:56 +00:00
|
|
|
|
|
|
|
})->purpose('Display an inspiring quote');
|