mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
fixes for activities
This commit is contained in:
parent
2545935d31
commit
cd8d479209
@ -1,41 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Listeners\Client;
|
|
||||||
|
|
||||||
use App\Models\Activity;
|
|
||||||
use App\Repositories\ActivityRepository;
|
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
||||||
use Illuminate\Queue\InteractsWithQueue;
|
|
||||||
|
|
||||||
class CreatedClient
|
|
||||||
{
|
|
||||||
protected $activityRepo;
|
|
||||||
/**
|
|
||||||
* Create the event listener.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function __construct(ActivityRepository $activityRepo)
|
|
||||||
{
|
|
||||||
$this->activityRepo = $activityRepo;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handle the event.
|
|
||||||
*
|
|
||||||
* @param object $event
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function handle($event)
|
|
||||||
{
|
|
||||||
|
|
||||||
$fields = new \stdClass;
|
|
||||||
|
|
||||||
$fields->client_id = $event->client->id;
|
|
||||||
$fields->user_id = $event->client->user_id;
|
|
||||||
$fields->company_id = $event->client->company_id;
|
|
||||||
$fields->activity_type_id = Activity::CREATE_CLIENT;
|
|
||||||
|
|
||||||
$this->activityRepo->save($fields, $event->client);
|
|
||||||
}
|
|
||||||
}
|
|
@ -4,7 +4,7 @@ namespace App\Providers;
|
|||||||
|
|
||||||
use App\Events\Client\ClientWasCreated;
|
use App\Events\Client\ClientWasCreated;
|
||||||
use App\Events\User\UserCreated;
|
use App\Events\User\UserCreated;
|
||||||
use App\Listeners\Client\CreatedClient;
|
use App\Listeners\Client\CreatedClientActivity;
|
||||||
use App\Listeners\SendVerificationNotification;
|
use App\Listeners\SendVerificationNotification;
|
||||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ class EventServiceProvider extends ServiceProvider
|
|||||||
|
|
||||||
// Clients
|
// Clients
|
||||||
ClientWasCreated::class => [
|
ClientWasCreated::class => [
|
||||||
CreatedClient::class,
|
CreatedClientActivity::class,
|
||||||
// 'App\Listeners\SubscriptionListener@createdClient',
|
// 'App\Listeners\SubscriptionListener@createdClient',
|
||||||
],
|
],
|
||||||
'App\Events\ClientWasArchived' => [
|
'App\Events\ClientWasArchived' => [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user