lasthourcloud/routes/console.php
Joao Patricio aea6bced69 wip
2023-05-23 12:32:11 +01:00

45 lines
1.3 KiB
PHP

<?php
use Illuminate\Foundation\Inspiring;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Support\Facades\Artisan;
use Symfony\Component\Mailer\Mailer;
/*
|--------------------------------------------------------------------------
| 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.
|
*/
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);
// For testing custom SMTP Mailer
\Illuminate\Support\Facades\Mail::mailer('smtp')
->to('ask@me.com')
->send(new \App\Mail\ExampleMail);
// For sending a notification
// \Illuminate\Support\Facades\Notification::send(
// \App\Models\User::find(1),
// new \App\Notifications\TestMessage
// );
})->purpose('Display an inspiring quote');