It looks like the framework uses a UNIX socket or a Host/Port connection when looking at illuminate\Database\Connectors\MySqlConnector. I don't see any kind of timeout or keep alive. All I could find was many checks to see if connection alive. So, I am assuming that the connection is kept alive.
As far as I know PHP closes connections at the end of the script if not specificaly asked to be persistent connections, and I believe Laravel don't do that, then I'd say yes, the connection is closed.
public function connect(array $config)
{
$dsn = $this->getDsn($config);
$options = $this->getOptions($config);
// We need to grab the PDO options that should be used while making the brand
// new connection instance. The PDO options control various aspects of the
// connection's behavior, and some might be specified by the developers.
/////////more code
I was wondering if you are paginating a resultset, is a brand new connection established each time. I know in an older style "single page php / pdo" application I am pretty sure the connection instance was created and disposed between each page load.
@jlrdw That is a great question. You would think that once a connection is made, it would persist for at least a certain amount of time for efficiency. I do think Laravel Paginator is setup to grab all data to be paginated at start and then paginate results as instructed.
Have a look here laravel/framework/src/Illuminate/Session/DatabaseSessionHandler.php