Retargetinglist.php 940 Bytes
<?php

namespace App\Models;

use App\Models\Pivots\GoalRetargetinglist;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Collection;

class Retargetinglist extends Model
{
    use SoftDeletes;

    const TYPE_RETARGETING = 'RETARGETING';
    const TYPE_AUDIENCE = 'AUDIENCE';

    protected $table = 'retargetinglists';

    protected $fillable = [
        'external_id',
        'type',
        'name',
        'description',
        'rules',
    ];

    protected $casts = [
        'rules' => 'json',
    ];

    /**
     * @return Collection
     */
    static public function getPropertiesWatch()
    {
        return collect([
            'type',
            'name',
            'description',
            'rules',
        ]);
    }

    public function goalRetargetinglists()
    {
        return $this->hasMany(GoalRetargetinglist::class, 'retargetinglist_id');
    }

}