mirror of
https://github.com/brunofontes/shareit.git
synced 2025-11-15 07:50:54 -03:00
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:
@@ -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,
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user