public function handle() { // Filter global methods if (method_exists($this, 'setup')) { $this->setup(); } // Run input filters $this->filterInput(); // Set up all the whereHas and joins constraints $this->filterRelations(); return $this->query; }