actengage/laravel-passendo is a Laravel package for a passendo package for laravel..
It currently has 0 GitHub stars and 494 downloads on Packagist (latest version v0.6.0).
Install it with composer require actengage/laravel-passendo.
Discover more Laravel packages by actengage
or browse all Laravel packages to compare alternatives.
Last updated
This is a Laravel package that makes tracking Passendo clicks easy. This package includes migrations, models, jobs, and the various handles to retry failed attempts.
composer require actengage/laravel-passendo
The easiest way to use this package is to attach the trait to an Eloquent model.
You must implement a cpa() and tid() method to fetch the CPA's and tracking
ID's (respectively).
use Actengage\LaravelPassendo\Contracts\TrackPassendoClicks as TrackPassendoClicksInterface;
use Actengage\LaravelPassendo\TrackPassendoClicks;
use Illuminate\Database\Eloquent\Model;
class User extends Model implements TrackPassendoClicksInterface {
use Optionable, TrackPassendoClicks;
public function cpa(): float
{
return $this->options->get('cpa');
}
public function tid(): string
{
return $this->tracking_id;
}
public function shouldTrackPassendoClicks(): bool
{
return true;
}
}
Click model.You can also create \Actengage\LaravelPassendo\Click models just as any other
Eloquent model. Give the tracking_id and cpa attributes a value, and the
jobs will automatically dispatch.
use Actengage\LaravelPassendo\Click;
// Manually create a click model
$click = Click::create([
'tracking_id' => 'test1',
'cpa' => 1
]);
You may optionally associate a polymorphic relationship, which associates the click to a parent model.
$user = User::firstOrCreate([
'email' => '[email protected]'
]);
$click->parent()->associate($user);
TrackPassendoClicks trait.If you are implementing the \Actengage\LaravelPassendo\TrackPassendoClicks
trait, then you can use the clicks() helper to create and associate a model
at once.
User::create()->clicks()->create([
'tracking_id' => 'test2',
'cpa' => 1
]);