query = $query; $this->items = $items; } public static function init($query, $items) { return new Scope($query, $items); } public function run() { foreach ($this->items as $index => $item) { Filter::init($this->query, $item, $index == 0)->run(); } // dd($this->query->toSql()); return $this->query; } }