GoalAdvertisementGoalAdExtension.php 842 Bytes
<?php

namespace App\Models\Pivots;

use App\Models\AdExtension;
use App\Models\Advertisement;
use Illuminate\Database\Eloquent\Relations\Pivot;

class GoalAdvertisementGoalAdExtension extends Pivot
{
    protected $table = 'goal_advertisement_goal_ad_extensions';

    protected $fillable = [
        'goal_advertisement_id',
        'goal_ad_extension_id',
    ];

    public $incrementing = true;

    static public function getWithPivot()
    {
        return [
            'id',
            'goal_advertisement_id',
            'goal_ad_extension_id',
        ];
    }

    public function goalAdvertisement()
    {
        return $this->belongsTo(GoalAdvertisement::class, 'goal_advertisement_id');
    }

    public function adExtension()
    {
        return $this->belongsTo(GoalAdExtension::class, 'goal_ad_extension_id');
    }

}