<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class SellerProduct extends Model
{
    protected $fillable = ['user_id', 'title', 'description', 'price', 'category', 'status'];

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

    public function accounts()
    {
        return $this->hasMany(SellerAccount::class);
    }

    public function availableAccounts()
    {
        return $this->hasMany(SellerAccount::class)->where('is_sold', false);
    }
}
