App\Listeners\ClientActionLog::handle PHP Method

handle() public method

Handle the event.
public handle ( ClientAction $event ) : void
$event App\Events\ClientAction
return void
    public function handle(ClientAction $event)
    {
        $client = $event->getClient();
        switch ($event->getAction()) {
            case 'created':
                $text = Lang::get('misc.log.client.created', ['company' => $client->company_name, 'assignee' => $client->AssignedUser->name]);
                break;
            default:
                break;
        }
        $activityinput = array_merge(['text' => $text, 'user_id' => Auth()->id(), 'type' => Client::class, 'type_id' => $client->id, 'action' => $event->getAction()]);
        Activity::create($activityinput);
    }
ClientActionLog