where(function ($query) use ($keyword) { $query->where('name', 'like', "%$keyword%") ->orWhere('dimensional_spesification', 'like', "%$keyword%") ->orWhere('unit', 'like', "%$keyword%"); }); } public function suppliers() { return $this->belongsToMany(Supplier::class, 'supplier_vendor_product_prices') ->withPivot('description', 'price'); } public function purchaseRequestVendors() { return $this->hasOne(PurchaseRequestVendor::class); } public function unitPrices() { return $this->belongsToMany(UnitPrice::class, 'unit_price_products') ->withPivot('qty'); } }