src/Concerns/InteractsWithDatabase.php
protected function getConnection($connection = null)
    {
        $database = $this->app->make('db');

        $connection = $connection ?: $database->getDefaultConnection();

        return $database->connection($connection);
    }
protected function getConnection($connection = null)
    {
        $database = $this->app->make('db');

        $connection = $connection ?: $database->getDefaultConnection();

        return $database->connection($connection);
    }
protected function getConnection ( $ connection = null ) { $ database = $ this -> app -> make ( 'db' ) ; $ connection = $ connection ? : $ database -> getDefaultConnection ( ) ; return $ database -> connection ( $ connection ) ; }
Get the database connection.

@param  string|null  $connection
@return \Illuminate\Database\Connection
Get the database connection .