<?php

namespace Modules\Coupon\Models;


use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Modules\Product\Models\Product;

class Coupon extends Model
{
    //use soft delete
    use SoftDeletes;

    protected $fillable = [
       'title', 'code'	,'start_date','end_date',	'status','discount_status','discount',	'count','user_count'
    ];


    public function products()
    {
        return $this->belongsToMany(Product::class,'coupon_products','coupon_id','product_id');
    }

}
