phinx = $phinx; $this->updater = $updater; } public function __invoke(Request $request, Handler $handler): Response { $query = "SHOW TABLES"; $st = \ORM::get_db()->query($query); $r = $st->fetchAll(\PDO::FETCH_ASSOC); if (count($r) == 0) { $this->phinx->getMigrate(); $this->phinx->getSeed(); $this->updater->update(); } return $handler->handle($request); } }