invoiceninja/app/Providers/EventServiceProvider.php

123 lines
3.6 KiB
PHP
Raw Normal View History

2018-10-04 20:10:43 +03:00
<?php
2019-05-11 13:32:07 +10:00
/**
* Invoice Ninja (https://invoiceninja.com)
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2019. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://opensource.org/licenses/AAL
*/
2018-10-04 20:10:43 +03:00
namespace App\Providers;
2019-04-20 11:19:43 +10:00
use App\Events\Client\ClientWasCreated;
2019-07-10 11:50:49 +10:00
use App\Events\Contact\ContactLoggedIn;
2019-05-15 15:03:18 +10:00
use App\Events\Invoice\InvoiceWasCreated;
use App\Events\Invoice\InvoiceWasMarkedSent;
use App\Events\Invoice\InvoiceWasPaid;
2019-05-15 15:03:18 +10:00
use App\Events\Invoice\InvoiceWasUpdated;
2019-05-13 16:18:46 +10:00
use App\Events\Payment\PaymentWasCreated;
use App\Events\Payment\PaymentWasDeleted;
2019-06-04 07:46:46 +10:00
use App\Events\User\UserLoggedIn;
2019-06-12 14:22:05 +10:00
use App\Events\User\UserWasCreated;
2019-05-13 16:18:46 +10:00
use App\Listeners\Activity\CreatedClientActivity;
2019-05-15 15:03:18 +10:00
use App\Listeners\Activity\PaymentCreatedActivity;
use App\Listeners\Activity\PaymentDeletedActivity;
2019-07-10 11:50:49 +10:00
use App\Listeners\Contact\UpdateContactLastLogin;
use App\Listeners\Invoice\CreateInvoiceActivity;
use App\Listeners\Invoice\CreateInvoiceHtmlBackup;
use App\Listeners\Invoice\CreateInvoiceInvitation;
2019-08-29 14:07:04 +10:00
use App\Listeners\Invoice\CreateInvoicePdf;
use App\Listeners\Invoice\UpdateInvoiceActivity;
2019-10-02 08:44:13 +10:00
use App\Listeners\Invoice\UpdateInvoiceInvitations;
2019-10-01 11:56:48 +10:00
use App\Listeners\Invoice\UpdateInvoicePayment;
2018-10-24 14:50:15 +11:00
use App\Listeners\SendVerificationNotification;
2019-06-04 07:46:46 +10:00
use App\Listeners\User\UpdateUserLastLogin;
2018-10-04 20:10:43 +03:00
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
class EventServiceProvider extends ServiceProvider
{
/**
* The event listener mappings for the application.
*
* @var array
*/
protected $listen = [
2019-06-12 14:22:05 +10:00
UserWasCreated::class => [
2018-10-24 14:50:15 +11:00
SendVerificationNotification::class,
2019-04-20 11:19:43 +10:00
],
2019-06-04 07:46:46 +10:00
UserLoggedIn::class => [
UpdateUserLastLogin::class,
],
2019-07-10 11:50:49 +10:00
ContactLoggedIn::class => [
UpdateContactLastLogin::class,
],
2019-04-20 11:19:43 +10:00
// Clients
ClientWasCreated::class => [
2019-04-21 22:28:28 +10:00
CreatedClientActivity::class,
2019-04-21 22:24:26 +10:00
// 'App\Listeners\SubscriptionListener@createdClient',
2019-04-20 11:19:43 +10:00
],
2019-05-13 16:18:46 +10:00
PaymentWasCreated::class => [
PaymentCreatedActivity::class,
2019-10-03 21:50:50 +10:00
//UpdateInvoicePayment::class,
//UpdateInvoiceInvitations::class,
2019-05-13 16:18:46 +10:00
],
PaymentWasDeleted::class => [
PaymentDeletedActivity::class,
],
2019-04-20 11:19:43 +10:00
'App\Events\ClientWasArchived' => [
'App\Listeners\ActivityListener@archivedClient',
],
'App\Events\ClientWasUpdated' => [
'App\Listeners\SubscriptionListener@updatedClient',
],
'App\Events\ClientWasDeleted' => [
'App\Listeners\ActivityListener@deletedClient',
'App\Listeners\SubscriptionListener@deletedClient',
'App\Listeners\HistoryListener@deletedClient',
],
'App\Events\ClientWasRestored' => [
'App\Listeners\ActivityListener@restoredClient',
],
//Invoices
2019-05-15 15:03:18 +10:00
InvoiceWasMarkedSent::class => [
CreateInvoiceHtmlBackup::class,
2019-05-15 15:03:18 +10:00
],
InvoiceWasUpdated::class => [
UpdateInvoiceActivity::class,
2019-08-29 14:07:04 +10:00
CreateInvoicePdf::class,
2019-05-15 15:03:18 +10:00
],
InvoiceWasCreated::class => [
CreateInvoiceActivity::class,
2019-08-29 14:07:04 +10:00
CreateInvoicePdf::class,
],
InvoiceWasPaid::class => [
CreateInvoiceHtmlBackup::class,
]
];
/**
* The subscriber classes to register.
*
* @var array
*/
protected $subscribe = [
2018-10-04 20:10:43 +03:00
];
/**
* Register any events for your application.
*
* @return void
*/
2019-06-05 10:43:23 +10:00
public function boot()
2018-10-04 20:10:43 +03:00
{
2019-06-05 10:43:23 +10:00
parent::boot();
2019-06-04 07:46:46 +10:00
2018-10-04 20:10:43 +03:00
}
}