Skip to content
Advertisement

Tag: query-builder

How to change Eloquent Builder’s connection?

I have a Eloquent Builder and two database connections(mysql_server1, mysql_server2) as below: Now how can I change the connection of $builder? Any helps would be appreciated Answer Need to get the Query from Eloquent Builder and set a new connection to that and set the new query to the Eloquent Builder as below:

Symfony 5 queryBuilder count data

in one of my queries I am joining three tables to allow me to filter by taking into account these three tables. The problem is when I do a counter of the data from the main table (CV table), like I join the language table (ManyToMany), the categories table and the diploma table (manyToMany), when I do a counter of

Make A Dynamical Model With Join CodeIgniter

I asked this question yesterday but it got deleted because admins said it got similar question with other post but when I check it there it doesn’t have the same problem with me, so ill ask again and hope that admin can understand. I have this model in CodeIgniter: It has a parameter that I can use dynamically (I mean

Adding custom collection to the eloquent within Laravel Query Builder

I have a query and I want to add a collection using Laravel query builder. Well, this returns: SQLSTATE[HY093]: Invalid parameter number: mixed named and positional parameters (SQL: select [{“id”:1,”name”:”John Avenue”},{“id”:4,”name”:”Ontirio Village”},{“id”:2,”name”:”Rovie”},{“id”:3,”name”:”Movie Lot”}] from dogs limit 100 offset 0) I know this may seem like an anti-pattern but the reason I need this is because I have a datatable and

Advertisement