NegativeKeywordSharedSet.php 924 Bytes
<?php

namespace App\Models;

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

class NegativeKeywordSharedSet extends Model
{
    use SoftDeletes;

    protected $table = 'negative_keyword_shared_sets';

    protected $fillable = [
        'external_id',
        'name',
        'negative_keywords',
        'associated',
    ];

    protected $casts = [
        'negative_keywords' => 'array',
        'associated' => 'boolean',
    ];

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

    public function goalNegativeKeywordSharedSet()
    {
        return $this->hasMany(GoalNegativeKeywordSharedSet::class, 'negative_keyword_shared_set_id');
    }

}