mirror of
https://github.com/brunofontes/shareit.git
synced 2024-11-24 12:17:10 +00:00
Bruno Fontes
528d3b4caf
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.
41 lines
855 B
PHP
41 lines
855 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
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
|
|
{
|
|
/**
|
|
* The event listener mappings for the application.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $listen = [
|
|
Registered::class => [
|
|
SendEmailVerificationNotification::class,
|
|
],
|
|
|
|
ReturnItem::class => [
|
|
AlertReturnedItem::class,
|
|
],
|
|
];
|
|
|
|
/**
|
|
* Register any events for your application.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function boot()
|
|
{
|
|
parent::boot();
|
|
|
|
//
|
|
}
|
|
}
|