<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class PurchaseItem extends Model { protected $fillable=['purchase_id','fuel_type_id','fuel_quality_id','tank_id','owner_type','customer_id','quantity','unit_price','total']; public function purchase(){return $this->belongsTo(Purchase::class);} public function fuelType(){return $this->belongsTo(FuelType::class);} public function quality(){return $this->belongsTo(FuelQuality::class,'fuel_quality_id');} public function tank(){return $this->belongsTo(Tank::class);} public function customer(){return $this->belongsTo(Customer::class);} }
