<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class SubscribePlan extends Model
{
    use HasFactory;

    protected $fillable = [
        'name',
        'price',
        'expired_day',
        'is_active',
        'is_free',
        'type',
        'transaction'
    ];

    public function users()
    {
        return $this->belongsToMany(User::class, 'user_subscribers');
    }

    public function userSubscribers()
    {
        return $this->hasMany(UserSubscriber::class);
    }
}
