<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * @mixin IdeHelperProfileSubscriptions
 */
class ProfileSubscriptions extends Model
{
    protected $fillable = [
        'user_id',
        'subscribable_type',
        'subscribable_id',
        'notify_new_listing',
        'notify_price_drops'
    ];

    protected $casts = [
        'notify_new_listing' => 'boolean',
        'notify_price_drops' => 'boolean'
    ];

    public function user()
    {
        return $this->belongsTo(User::class);
    }

    public function subscribable()
    {
        return $this->morphTo();

    }


}
