<?php

namespace App\Models\User;

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

class Purchase extends Model
{
    // If your table name is not 'purchases', uncomment and set it
    // protected $table = 'purchases';
use SoftDeletes;
    protected $fillable = [

         'user_id',
         'supplier_id',
         'member_id', 
         'supplier_name', 
         'supplier_contact', 
         'supplier_address', 
         'line_id', 
         'line_name', 
         'items_id', 
         'date', 
         'total_amount', 
       
         'paid_amount',
       
    ];

    // Relationships
    public function member()
    {
        return $this->belongsTo(Member::class);
    }

public function items()
{
    return $this->hasMany(\App\Models\User\PurchaseItem::class, 'items_id');
}


}
