Sitelink.php 714 Bytes
<?php

namespace App\Models;

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

class Sitelink extends Model
{
    use SoftDeletes;

    protected $table = 'sitelinks';

    protected $fillable = [
        'token_id',
        'external_id',
        'links',
    ];

    protected $casts = [
        'links' => 'array',
    ];

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

    public function goalSitelinks()
    {
        return $this->hasMany(GoalSitelink::class, 'sitelink_id');
    }

}