<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\GlobalModelEvents;

class Vendor extends Model
{
    use HasFactory, GlobalModelEvents;

    protected $fillable = [
        'user_id', 'status',
    ];

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

    public function products()
    {
        return $this->hasMany(VendorProduct::class, 'vendor_id', 'id');
    }
}
