belongsTo(Invoice::class); } public function scopeByInvoice($query, $invoice_id) { return $query->where('invoice_id', $invoice_id); } }