App\Events\ClientAction::getAction PHP Method

getAction() public method

public getAction ( )
    public function getAction()
    {
        return $this->action;
    }

Usage Example

Esempio n. 1
0
 /**
  * Handle the event.
  *
  * @param  ClientAction  $event
  * @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);
 }