<?php

namespace App\Models;

use App\Models\Backoffice\MediaItem;
use App\Models\Backoffice\Support\ContentTypeModel;
use App\Models\Backoffice\Traits\LanguageSupportTrait;
class SubscriptionReward extends ContentTypeModel
{
    use LanguageSupportTrait;

    protected $hidden = ['languages', "websites"];
    protected $with = ['languages', "websites"];

    public function subPlans()
    {
        return $this->belongsToMany(SubPlan::class, 'sub_plan_subscription_reward')
            ->withPivot('position')
            ->orderBy('position');
    }

    public function image()
    {
        return $this->belongsTo(MediaItem::class, 'image_id');
    }
}
