company_id = $company_id; $this->db = $db; $this->middleware_key = "bank_match_rate:{$this->company_id}"; } public function handle() :void { MultiDB::setDb($this->db); BankTransaction::where('company_id', $this->company_id) ->where('status_id', BankTransaction::STATUS_UNMATCHED) ->cursor() ->each(function ($bt){ (new BankService($bt))->processRules(); }); } public function middleware() { return [new WithoutOverlapping($this->middleware_key)]; } }