All Questions
87 questions
-1
votes
1
answer
43
views
Calculating the number of values from a relation table based on a date range
table bayarlanjas
| tglbayar | bayarlanja |user_id|
| ---------- | ---------- |-------|
| 2024-01-05 | 10 | 1 |
| 2024-02-06 | 20 | 1 |
| 2024-03-07 | 30 | 1 |
| ...
0
votes
1
answer
88
views
Laravel join 3 tables and get the SUM
I have 3 tables in my MariaDB 10.4.10 database which are orders, commissions and order_items.
Below is the table structure.
Orders
Commissions
Order Items
I want to get Totla commissions, and Total ...
0
votes
1
answer
349
views
Convert SQL query to eloquent query with relationship in Laravel
I want to convert this SQL query to an eloquent query :
SELECT
round(AVG(rating.reviews), 2) as avg_rating,
COUNT(excursions.id) as review_total,
excursions.name
FROM
reviews
LEFT ...
-1
votes
3
answers
68
views
how join laravel tables to get non intersected data
in my Laravel app I have 3 tables : users, documents and type_documents, the user have multiple documents and document have one type_document
| Documents |
| -------- |
| id ...
0
votes
1
answer
1k
views
Use parameter with DB::raw in Laravel 9
I have this SQL query which returns all employees based on selected date :
SELECT employees.id as employee_id ,employees_salaries.*,CONCAT(first_name,' ',second_name,' ',third_name) as fullname FROM ...
-3
votes
1
answer
444
views
How to resolve ambiguous error in the query
I am using laravel framework for developing API's ,i have one query that is executed without where condition without any error i need to execute with where condition but it's throwing an error
query
...
-2
votes
1
answer
67
views
sql join with multiple conditions on columns
I don't think I can achieve this with unions.
For example, I want all cars where the key-column is "brand" and value-column is "Burago".
On top of that, the key-column price with ...
0
votes
1
answer
412
views
How to update a column by joining four tables in laravel
I have four tables
default_products_product_mileage_gap
default_products_mileage_gap
default_products_products
default_products_products_mileage_gaps
I am trying to update a column ...
0
votes
1
answer
611
views
Server side Jquery datatable showing requested unknown parameter in laravel (FIxed) but ssearching is not working by address name
Previous Issue has been solved but currently search is not working when I am trying to search by address name.
For your reference, I'm using "https://datatables.net/examples/data_sources/...
1
vote
1
answer
272
views
Laravel sum join with condition
I have products, warehouses, transactions and transaction_details table.
$p = Product::leftJoin('transaction_details', 'products.id', '=' ,'transaction_details.product_id')
->leftJoin('...
0
votes
1
answer
190
views
Laravel duplicates join on production
I have a code where Eloquent query builder joins the ManyToOne tables articles and users.
The code looks like:
$model = Article::with('user')->select('articles.*'));
and then the model filters the ...
0
votes
1
answer
40
views
Laravel Controller SQL: joining two tables multiplies the output
To quickly summarize, my first table's rows gets multiplied by the amount of rows in the second table possibly due to my join:
Table 1:(bbr_group) I only have two rows
1
Table 2:(bbr_group_type) I ...
1
vote
1
answer
129
views
How to list the customers by last time they buy in Laravel Query
I try to sort my customers list by their last order from table Orders.
But all is not working.
Please help me how to write Laravel 5.x Query.
Detail in the following link
Thank you very much!
This is ...
0
votes
1
answer
159
views
Laravel - DB::TABLE SQL - how to get join data in one queries
I Have 2 tables first client_group with data like below
second table client
in Controller I have code like below:
$client = DB::table('client_group')
->where('client_group.user_id'...
0
votes
2
answers
59
views
Convert sql join query to laravel
SELECT school_courses.*, schools.school_name, schools.country, schools.city FROM
school_courses JOIN schools ON school_courses.school_id = schools.id
Hello there,
I want to convert the above SQL ...