src/Laralabs/ConnectionLoader/ConnectionLoader.php
public static function checkConnections($connection_name, $table, $check)
    {
        if($check === true)
        {
            $connections = DB::connection($connection_name)->table($table)->get();

            foreach($connections as $connection)
            {
                $name = $connection->name;

                try{
                    $testConnection = DB::connection($name)->getPdo();
                }catch(\Exception $e)
                {
                    $error = $e->getMessage();
                    \error_log($error);
                }
                if(!empty($testConnection) && empty($error))
                {
                    $update = DB::connection($connection_name)->table($table)->where('name', $name)->update(['status' => true]);
                }
                else
                {
                    $update = DB::connection($connection_name)->table($table)->where('name', $name)->update(['status' => false]);
                }
            }
        }
    }
public static function checkConnections($connection_name, $table, $check)
    {
        if($check === true)
        {
            $connections = DB::connection($connection_name)->table($table)->get();

            foreach($connections as $connection)
            {
                $name = $connection->name;

                try{
                    $testConnection = DB::connection($name)->getPdo();
                }catch(\Exception $e)
                {
                    $error = $e->getMessage();
                    \error_log($error);
                }
                if(!empty($testConnection) && empty($error))
                {
                    $update = DB::connection($connection_name)->table($table)->where('name', $name)->update(['status' => true]);
                }
                else
                {
                    $update = DB::connection($connection_name)->table($table)->where('name', $name)->update(['status' => false]);
                }
            }
        }
    }
public static function checkConnections ( $ connection_name , $ table , $ check ) { if ( $ check === true ) { $ connections = DB :: connection ( $ connection_name ) -> table ( $ table ) -> get ( ) ; foreach ( $ connections as $ connection ) { $ name = $ connection -> name ; try { $ testConnection = DB :: connection ( $ name ) -> getPdo ( ) ; } catch ( \ Exception $ e ) { $ error = $ e -> getMessage ( ) ; \ error_log ( $ error ) ; } if ( ! empty ( $ testConnection ) && empty ( $ error ) ) { $ update = DB :: connection ( $ connection_name ) -> table ( $ table ) -> where ( 'name' , $ name ) -> update ( [ 'status' => true ] ) ; } else { $ update = DB :: connection ( $ connection_name ) -> table ( $ table ) -> where ( 'name' , $ name ) -> update ( [ 'status' => false ] ) ; } } } }
checkConnections function.

If enabled in the configuration file this will check the connections
and update the status field in the table provided for each
connection with a boolean value.

@param $connection_name
@param $table
@param $check
checkConnections function .