belongsTo('App\Models\Document\Document')->withoutGlobalScope('App\Scopes\Document'); } public function scopeType(Builder $query, string $type) { return $query->where($this->qualifyColumn('type'), '=', $type); } public function scopeInvoice(Builder $query) { return $query->where($this->qualifyColumn('type'), '=', Document::INVOICE_TYPE); } public function scopeBill(Builder $query) { return $query->where($this->qualifyColumn('type'), '=', Document::BILL_TYPE); } }