A single application of laravel with many database

1

I have an application with the Laravel framework that I have created many subdomains to access. Today I make a separate environment for each one, but the files in each of them will be the same.

My question is, is it possible to make a single environment to reduce disk space on the server, but with separate databases.

I wonder if anyone did something like this and how you did it.

    
asked by anonymous 20.08.2018 / 21:31

1 answer

2

Just check this link: Using Multiple Database Connections

You can get the connection as:

$users = DB::connection('foo')->select(...);

or

$pdo = DB::connection()->getPdo();'
    
20.08.2018 / 23:32