SQL Syntax Alias Error When Using Table Summarizer
My case is because I have multiple database connection on my application. So in every model I need to use:
I did this because somehow laravel will use wrong connection for any feature.
But when I am using summarize on the Table Builder like this:
It will return sql error like this:
It uses alias "AS db2.mytable" thats why it got me error, but if I comment my getTable() function on my Model it runs okay. So I am gonna comment my getTable function for now. Hopefully someone know any solution, because I do still need getTable to prevent the application from using wrong db otherwise it is either alias error or wrong db error.
ππ«‘
1 Reply
why you dont use the
protected $connection = 'connectionName';
on the model instead of setting it on the getTable