lasthourcloud/routes/console.php

45 lines
1.3 KiB
PHP
Raw Normal View History

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;
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.
|
*/
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-23 11:32:11 +00:00
// For sending a notification
// \Illuminate\Support\Facades\Notification::send(
// \App\Models\User::find(1),
// new \App\Notifications\TestMessage
// );
})->purpose('Display an inspiring quote');