mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Listeners
This commit is contained in:
parent
e494459823
commit
61b7481eda
30
app/Listeners/Client/CreatedClient.php
Normal file
30
app/Listeners/Client/CreatedClient.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Listeners\Client;
|
||||
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
|
||||
class CreatedClient
|
||||
{
|
||||
/**
|
||||
* Create the event listener.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the event.
|
||||
*
|
||||
* @param object $event
|
||||
* @return void
|
||||
*/
|
||||
public function handle($event)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
@ -2,7 +2,9 @@
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Events\Client\ClientWasCreated;
|
||||
use App\Events\User\UserCreated;
|
||||
use App\Listeners\Client\CreatedClient;
|
||||
use App\Listeners\SendVerificationNotification;
|
||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||
|
||||
@ -16,7 +18,27 @@ class EventServiceProvider extends ServiceProvider
|
||||
protected $listen = [
|
||||
UserCreated::class => [
|
||||
SendVerificationNotification::class,
|
||||
]
|
||||
],
|
||||
|
||||
// Clients
|
||||
ClientWasCreated::class => [
|
||||
CreatedClient::class,
|
||||
'App\Listeners\SubscriptionListener@createdClient',
|
||||
],
|
||||
'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',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -587,6 +587,16 @@ class CreateUsersTable extends Migration
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
});
|
||||
|
||||
|
||||
Schema::create('activities', function ($table) {
|
||||
$table->increments('id');
|
||||
$table->unsignedInteger('user_id');
|
||||
$table->unsignedInteger('company_id');
|
||||
|
||||
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user