Skip to content

Commit 8d76832

Browse files
committed
Skip logging email body
1 parent b011bb9 commit 8d76832

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

database/migrations/2020_04_19_170200_create_email_logs_table.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
use Illuminate\Support\Facades\Schema;
4-
use Illuminate\Database\Schema\Blueprint;
53
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
66

77
class CreateEmailLogsTable extends Migration
88
{
@@ -15,9 +15,8 @@ public function up()
1515
{
1616
Schema::create('email_logs', function (Blueprint $table) {
1717
$table->increments('id');
18-
// $table->unsignedInteger('user_id')->nullable();
1918
$table->string('subject');
20-
$table->text('body');
19+
$table->text('body')->nullable();
2120

2221
$table->timestamp('created_at');
2322
});

src/LaravelEmailLogger.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ public function handle($event)
88
{
99
EmailLog::create([
1010
'subject' => $event->message->getSubject(),
11-
'body' => $event->message->getBody(),
1211
]);
1312
}
1413
}

tests/ExampleTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
namespace Krisell\LaravelEmailLogger\Tests;
44

55
use Carbon\Carbon;
6-
use Orchestra\Testbench\TestCase;
76
use Illuminate\Foundation\Auth\User;
7+
use Illuminate\Foundation\Testing\RefreshDatabase;
88
use Illuminate\Support\Facades\Mail;
99
use Krisell\LaravelEmailLogger\EmailLog;
10-
use Illuminate\Foundation\Testing\RefreshDatabase;
11-
use Krisell\LaravelEmailLogger\Tests\TestMailable;
1210
use Krisell\LaravelEmailLogger\LaravelEmailLoggerServiceProvider;
11+
use Krisell\LaravelEmailLogger\Tests\TestMailable;
12+
use Orchestra\Testbench\TestCase;
1313

1414
class ExampleTest extends TestCase
1515
{
@@ -31,6 +31,5 @@ public function a_test()
3131
$event = EmailLog::first();
3232
$this->assertNotNull($event->created_at);
3333
$this->assertEquals('Test mail subject', $event->subject);
34-
$this->assertEquals('<h2>Email content. Good stuff.</h2>', $event->body);
3534
}
3635
}

0 commit comments

Comments
 (0)