App\Notifications\ClientActionNotification::toArray PHP Method

toArray() public method

Get the array representation of the notification.
public toArray ( mixed $notifiable ) : array
$notifiable mixed
return array
    public function toArray($notifiable)
    {
        switch ($this->action) {
            case 'created':
                $text = Lang::get('misc.notifications.client.created', ['company' => $this->client->company_name]);
                break;
            default:
                break;
        }
        return ['assigned_user' => $notifiable->id, 'created_user' => auth()->user()->id, 'message' => $text, 'type' => Client::class, 'type_id' => $this->client->id, 'url' => url('clients/' . $this->client->id), 'action' => $this->action];
    }