Manage data in foreign databases

Hi experts, I am very new to both Laravel and Filament, so maybe my question might be silly, but I did not yet find the answer, nor do I know how to quickly find out myself. So it would be very helpful if you guys could answer my question. I guess that this an absolute "no-brainer" for everyone with some experience in Filament an/or Laravel. I know that there is a database for Filament where various information is stored, beginning with the migrations or the user accounts and also all the models I create and where I add add manipulate data using Filament. In my usage scenario, I also have this default database where migrations and user accounts for Filament are stored. But there's also another database, currently not related with my application at all. This database belongs to a completely different software. But I would like to use Filament to manipulate data in that database, i.e. have different databases for the app (user accounts, migrations, "own" models of the app) and for the data to be manipulated. Is such a scenario possible with Filament? Best Tom
Solution:
Hmm. Might still be possible. Filament just defaults to Laravel’s eloquent orm. So if it’s possible at that level, Filament can still use it. The other option would be using the Sushi package if the remote dbs have an api integration. But it sounds like you need to look into making it work with Laravel first. If it works at that level it will work with Filament.
Jump to solution
6 Replies
awcodes
awcodes5mo ago
If the foreign db is on the same server you could use it. That’s a Laravel convention though and unrelated to filament. Filament uses Laravel’s conventions. It’s still just a Laravel app.
Obi Wan Kenobi
Obi Wan Kenobi5mo ago
unfortunately, there are tables on at least two servers. one of them is different to the Laravel host and even another dbms (Microsoft SQL Server) compared to the Laravel host. Is it planned to include such a feature? Thanks for the answer! Best regards Tom
Solution
awcodes
awcodes5mo ago
Hmm. Might still be possible. Filament just defaults to Laravel’s eloquent orm. So if it’s possible at that level, Filament can still use it. The other option would be using the Sushi package if the remote dbs have an api integration. But it sounds like you need to look into making it work with Laravel first. If it works at that level it will work with Filament.
awcodes
awcodes5mo ago
Sounds like it’s should be possible though with the right database drivers at the Laravel level.
Obi Wan Kenobi
Obi Wan Kenobi5mo ago
understand. I already worked with Laravel a bit, but don't currently know how to access data from another database. I'll have a look into that. That sounds like it could work. Thanks again for your support!
Tim van Heugten
Tim van Heugten5mo ago
Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.