Skip to content

Commit 9682b7c

Browse files
committed
2 parents a10d1ab + 64f78aa commit 9682b7c

File tree

6 files changed

+360
-0
lines changed

6 files changed

+360
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace App\Console\Commands;
4+
5+
use App\Notifications\TestNotification;
6+
use Illuminate\Console\Command;
7+
use Illuminate\Support\Facades\Mail;
8+
use Illuminate\Support\Facades\Notification;
9+
10+
class SendTestEmail extends Command
11+
{
12+
protected $signature = 'app:send-test-email {email}';
13+
14+
protected $description = 'Send a test email via the default mail driver.';
15+
16+
public function handle(): void
17+
{
18+
$this->info('Sending test email via '.Mail::getDefaultDriver().'...');
19+
20+
Notification::route('mail', $this->argument('email'))
21+
->notify(new TestNotification);
22+
}
23+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
namespace App\Notifications;
4+
5+
use Illuminate\Bus\Queueable;
6+
use Illuminate\Notifications\Messages\MailMessage;
7+
use Illuminate\Notifications\Notification;
8+
9+
class TestNotification extends Notification
10+
{
11+
use Queueable;
12+
13+
public function via(object $notifiable): array
14+
{
15+
return ['mail'];
16+
}
17+
18+
public function toMail(object $notifiable): MailMessage
19+
{
20+
return (new MailMessage)
21+
->subject('Test Notification')
22+
->greeting('It worked!')
23+
->line('This is a test mail notification.')
24+
->action('Go to Website', url(path: '/', secure: true));
25+
}
26+
}

composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
"sentry/sentry-laravel": "^4.13",
1717
"spatie/laravel-menu": "^4.1",
1818
"spatie/yaml-front-matter": "^2.0",
19+
"symfony/http-client": "^7.2",
20+
"symfony/mailgun-mailer": "^7.1",
1921
"torchlight/torchlight-commonmark": "^0.5.5"
2022
},
2123
"require-dev": {

composer.lock

Lines changed: 242 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*/
12+
public function up(): void
13+
{
14+
Schema::create('cache', function (Blueprint $table) {
15+
$table->string('key')->primary();
16+
$table->mediumText('value');
17+
$table->integer('expiration');
18+
});
19+
20+
Schema::create('cache_locks', function (Blueprint $table) {
21+
$table->string('key')->primary();
22+
$table->string('owner');
23+
$table->integer('expiration');
24+
});
25+
}
26+
27+
/**
28+
* Reverse the migrations.
29+
*/
30+
public function down(): void
31+
{
32+
Schema::dropIfExists('cache');
33+
Schema::dropIfExists('cache_locks');
34+
}
35+
};
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*/
12+
public function up(): void
13+
{
14+
Schema::create('jobs', function (Blueprint $table) {
15+
$table->bigIncrements('id');
16+
$table->string('queue')->index();
17+
$table->longText('payload');
18+
$table->unsignedTinyInteger('attempts');
19+
$table->unsignedInteger('reserved_at')->nullable();
20+
$table->unsignedInteger('available_at');
21+
$table->unsignedInteger('created_at');
22+
});
23+
}
24+
25+
/**
26+
* Reverse the migrations.
27+
*/
28+
public function down(): void
29+
{
30+
Schema::dropIfExists('jobs');
31+
}
32+
};

0 commit comments

Comments
 (0)