Skip to content
This repository has been archived by the owner on Nov 21, 2022. It is now read-only.

Commit

Permalink
Merge pull request #28 from spaantje/master
Browse files Browse the repository at this point in the history
Fix issue #27
  • Loading branch information
spaantje authored Dec 15, 2021
2 parents d91e86d + d536f4c commit 9c56f32
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/ShvetsGroup/LaravelEmailDatabaseLog/EmailLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace ShvetsGroup\LaravelEmailDatabaseLog;

use DB;
use Illuminate\Support\Facades\DB;
use Illuminate\Mail\Events\MessageSending;

class EmailLogger
Expand Down Expand Up @@ -56,4 +56,4 @@ function formatAddressField($message, $field)
}
return implode(', ', $strings);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace ShvetsGroup\LaravelEmailDatabaseLog;

use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Mail\Events\MessageSending;

class LaravelEmailDatabaseLogEventServiceProvider extends ServiceProvider
{
/**
* The event listener mappings for the application.
*
* @var array
*/
protected $listen = [
MessageSending::class => [
EmailLogger::class,
],
];
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,34 @@

namespace ShvetsGroup\LaravelEmailDatabaseLog;

use Illuminate\Foundation\Support\Providers\EventServiceProvider;
use Illuminate\Support\ServiceProvider;
use Illuminate\Mail\Events\MessageSending;

class LaravelEmailDatabaseLogServiceProvider extends EventServiceProvider
class LaravelEmailDatabaseLogServiceProvider extends ServiceProvider
{
/**
* The event listener mappings for the application.
*
* @var array
*/
protected $listen = [
MessageSending::class => [
EmailLogger::class,
],
];

/**
* Register any other events for your application.
*
* @return void
*/
public function boot()
{
parent::boot();
//
}



/**
* Register any application services.
*
* @return void
*/
public function register()
{
$this->publishes([
__DIR__ . '/../../database/migrations'=> database_path('migrations'),
], 'laravel-email-database-log-migration');
}
$this->app->register(LaravelEmailDatabaseLogEventServiceProvider::class);

if ($this->app->runningInConsole()) {
$this->publishes([
__DIR__ . '/../../database/migrations' => database_path('migrations'),
], 'laravel-email-database-log-migration');
}
}
}

0 comments on commit 9c56f32

Please sign in to comment.