Most voted "querybuilder" questions
19 questions
Sort by count of
-
4
votes2
answers2598
viewsHow to Insert Taking Data from FORM in Laravel 5.2?
I’m looking at the Laravel documentation on dbquery, in the Insert case. I need to do Insert outside of the Resource method (manually. Type: DB::table('users')->insert( ['email' =>…
-
2
votes2
answers97
viewsLaravel 5 Querybuilder, simplified collection results
I’m using the method get() of Laravel’s Querybuilder and would like to know if it is possible to return the id’s in a simple one-dimensional array, for example: [35,45] Instead of:…
-
2
votes2
answers1415
viewsError using whereRaw in Laravel
What am I doing wrong in this queryRaw? The goal is to display the summed values if ID = ID, but I’m getting the total sum of the column. Excerpt from *query made on Controller: //Show public…
-
2
votes1
answer841
viewsLaravel 5, assuming variable in empty query?
I have a query, but sometimes this query returns an empty value (off the books). These query results are directed to generating a graph Highcharts, but when there are no values within the query, the…
-
2
votes1
answer82
viewsJquery-Querybuilder does not work inside Vuejs
Good morning, I’m trying to use Jquery’s Querybuilder along with Vuejs, but I’m getting the following error: Below follows the code that is giving this error: this.$refs.builder.queryBuilder({…
-
1
votes0
answers49
viewsquery with Many-to-Many polymorphic Laravel?
I have a polymorphic m-m relationship in my bank where: class(id, name) student(id, name) Lesson(id, name) classeable(classe_id, classeable_id, classeable_type) a class has several Students and…
-
1
votes1
answer287
viewsReturn array within json
I have the following function in Laravel/QueryBuilder public function getEstudante(Request $request) { $estudante = DB::table('estudantes_identificacao')…
-
0
votes0
answers338
viewsLaravel Query Builder returning duplicate values?
I have the following problem, I have a select using leftJoin, more is returning duplicate records, the bank is not duplicated and when shooting the leftJoin works. Follows SQL Tabela processo…
-
0
votes0
answers150
viewsGroup By | Relationship Many To Many Laravel 5
I am developing an application in Laravel 5 where I have the tables employees, companies, exams, employee_exams and their respective fields according to Migration below: :: Companies Table public…
-
0
votes1
answer609
viewsConvert SQL query to Query Builder (Orange)
I would like to convert the following query SQL to Query Builder (Laravel): $duels = DB::select('SELECT r.id, r.name FROM tournaments t INNER JOIN duels d ON t.id = d.tournament_id INNER JOIN riders…
-
0
votes1
answer397
viewsConvert sql to query Builder - Laravel
I’m starting at Laravel and I have doubts about eloquent. Could someone help me convert that code SQL in eloquent? SELECT COUNT(d.id) as total, d.nome_disciplina FROM bd_assuntos as a INNER JOIN…
-
0
votes0
answers206
viewsStrange memory consumption PHP Laravel
All right guys, I’m using Laravel for a project and I’m kind of worried about using memory in some classes. So I decided to do a basic test and discover that a method was consuming a lot of memory…
-
0
votes1
answer610
viewsPass variable query buider Laravel
I am trying to do this function with Laravel Query Builder public function getEstudantesCargaHoraria(Request $request) { $ano_letivo = $request->ano_letivo; $turma_id = $request->id;…
-
0
votes2
answers77
viewsHelp Query Sum
I’m trying to retrieve a column and make a sum - using the SUM - according to the time zone, but without success. You can help me with this issue? Detail: I’m not using exactly a table, but perform…
-
0
votes1
answer119
viewsCreate query in query Builder - Standard
I’m starting to work with Laravel and need to make a query in the database, is a simple query, but as I’m starting I do not know yet perform it. I need to get the sales done today, yesterday, this…
-
0
votes1
answer54
viewsLaravel Query Builder - problem with two Join
Currently I have a query that takes the posts and searches through Join some user data $posts = \App\Post::join('users', 'users.id', '=', 'posts.author_id') ->select('posts.id', 'posts.title',…
-
0
votes1
answer88
viewsLaravel + Postgres - Return’t' or 'f' instead of true or false
Hello, When performing a query in a field booleano in the Postgres we have a return of 't' or 'f'. I’m having a problem trying to migrate an API made in Codeigniter for an API I am developing in…
-
-1
votes2
answers345
viewsProblems with Laravel Query Builder
I have the following problem, when trying to implement a consultation with joins, in query Builder: My Query (pure SQL): SELECT COUNT(*) as total, orgao.sigla AS sigla_org_uni FROM protocolo INNER…
-
-2
votes1
answer101
viewsColumn not found using ALIAS in Laravel
I am in trouble when accessing a column in the Windows query Builder, the following code works in Sql Workbench. Vendas::selectRaw('if(faturamento.Codfaturamento is null, vendas.totalvenda,…