One possible solution is to create a script that runs on a schedule and pulls the data from the databases using Laravel's Eloquent ORM, and then saves it to a CSV file. This CSV file can then be used as the data source for the PowerBI report.
Here's an example script that pulls data from a Laravel database and saves it to a CSV file:
<?php
use Illuminate\Support\Facades\DB;
// Connect to the database
DB::connection('mysql')->reconnect();
// Get the data from the database
$data = DB::table('my_table')->get();
// Convert the data to an array
$dataArray = json_decode(json_encode($data), true);
// Save the data to a CSV file
$fp = fopen('data.csv', 'w');
foreach ($dataArray as $row) {
fputcsv($fp, $row);
}
fclose($fp);
You can then run this script on a schedule using a tool like cron or Task Scheduler. For example, to run the script every hour, you could add the following line to your crontab:
0 * * * * /usr/bin/php /path/to/script.php
Note that you'll need to modify the script to pull data from both of your databases and combine it into a single CSV file.
Once you have the CSV file, you can use it as the data source for your PowerBI report. PowerBI supports automatic data refresh from a CSV file, so you can set up a schedule for the report to refresh itself.