public static function checkDb() { if (DB::connection('mysql')->table(DB::raw('DUAL'))->first([DB::raw(1)])) { return true; } return false; }
/** * Execute the console command. * * @return void */ public function handle() { if (ArtisanExt::checkDb()) { return $this->info('Succesfully connected to the database.'); } return $this->error('Failed to connect to the database.'); }