I have a Laravel backend which basically works as an API and dashboard for my database and its data. The data updated daily using a Python script directly to the database. Is there any way to trigger a Laravel Scout update (so that the row is updated in Algolia as well) outside the PHP project?
The only alternative I thought was to use a Laravel api to handle the changes between the python script and the database so that only Laravel can communicate directly to the database.
However, I would really prefer if there was a way to add a listener or whatever to that without using Laravel in between since the python script is REALLY fast.
There are two ways for that:
1). You can use Laravel API to update Algolia entries into database.
2). Maybe you can use Algolia Python Library.
I suggest you to use Laravel API. You can simply call API URL from Python Script. You need to write clear PHP code of Laravel controller API, because python is fast and it will need to communicate fast with api.
Also: You can simply use Python module named flask to connect to your laravel database and make changes what you want in database. (Every database can be managed from different programming languages such as PHP, Ruby on Rails, Python and etc.)
Only laravel can't communicate to your database, it can be done from Python too (But of course it's mainly possible from laravel too).