Refactoring: TakeController returned item Mail moved to a listener

The TakeController was manually sending the email message
as well as dealing with item return, so I moved the email message
to it's own listener, I created an event for it and moved the
return part to the item model.
This commit is contained in:
2018-09-30 21:32:33 -03:00
parent 8575895341
commit 1e1c178214
5 changed files with 99 additions and 14 deletions

View File

@@ -6,6 +6,8 @@ use Illuminate\Support\Facades\Event;
use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use App\Events\ReturnItem;
use App\Listeners\AlertReturnedItem;
class EventServiceProvider extends ServiceProvider
{
@@ -18,6 +20,10 @@ class EventServiceProvider extends ServiceProvider
Registered::class => [
SendEmailVerificationNotification::class,
],
ReturnItem::class => [
AlertReturnedItem::class,
],
];
/**