<?php
/**
 * Created by PhpStorm.
 * User: ashis
 * Date: 2020-05-11
 * Time: 04:45 PM
 */

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;


class Products extends Model
{
    use SoftDeletes;

    protected $table = 'products';

    protected $fillable = ['merchant_id','name', 'code', 'warranty', 'description', 'amount','updated_by','center_id'];

    public function merchant()
    {
        return $this->hasOne('App\Merchant','id','merchant_id');
    }

    public function center()
    {
        return $this->hasOne('App\MerchantLocation','id','center_id');
    }

    public function productOffer()
    {
        return $this->hasMany('App\ProductOffers','product_id','id');
    }
}
