[Bug]: connection field in model is ignored
Bug description
My model looks like this:
class ClientString extends Model
{
protected $connection = 'localization';
}
All other models use the default connection (DB_CONNECTION), but this model uses an external db (defined in the database config). This is supported in Laravel and works perfectly.
I don't use migrations, so I use "Fetch data from connection".
But when I generate the helper code, I get: Table not found for App\Models\ClientString (strings)
It seems the plugin does not respect the connection setting in the model.
Plugin version
8.1.3.233
Operating system
MacOS
Steps to reproduce
No response
Relevant log output
No response
I'm a little surprised there is no reaction to this one as it seems to be a basic feature that should work, and the problem is perfectly reproducible, and the fix should be fairly easy.
Hello. Sorry for the long response. Have you tried adding this connection(you can set up multiple connections there) in the Helper Code Parameters window? main menu > Laravel > Helper Code Parameters...
Thanks, that worked! I think I previously did not realise this is a multi-select box.