Shems Eddine
Shems Eddine

Reputation: 141

Handling Multiple Databases in Laravel

I'm working on a fairly large project at the moment and there is data that I'm wanting to be stored in a different database. how would I handle that in laravel?

Upvotes: 1

Views: 516

Answers (1)

Antonio Carlos Ribeiro
Antonio Carlos Ribeiro

Reputation: 87779

It's simple, you can do things like:

User::connection('another-connection-name')->where('email', '[email protected]')->first();

In Laravel, switching to a different database connection at any time.

Here's also a post about this: http://fideloper.com/laravel-multiple-database-connections

Upvotes: 2

Related Questions