All Questions
16,697 questions
1
vote
0
answers
39
views
How can I query for a price rate based on the price effective from date after determining the contry from a phone number [duplicate]
I am trying to figure out how I can add surcharge rates to a set of call records. Up until recently the rates have never changed and I am able to get the right rate for a Call Detail Record (CDR) but ...
-1
votes
0
answers
65
views
Problems starting MySQL on GitPod
I'm trying out GitPod to practice with Laravel, but I'm having a problem: every time I launch the workspace, I have to install MySQL, create the database, and import it. I've already created the ....
-4
votes
2
answers
108
views
Convert this Eloquent model function to a MySQL query? [closed]
I need to convert this Eloquent Model Function to a MySQL Query:
public function currentPrice(): HasOne
{
return $this->hasOne(Price::class)->ofMany([
'published_at' =>...
1
vote
0
answers
101
views
How to Eager Load Aggregated Fixtures from Original and Duplicated Competitions in Laravel?
I'm working with a database design where competitions can be duplicated, and I need to efficiently query original competitions along with aggregated fixtures from both the original and duplicated ...
0
votes
0
answers
54
views
How to prevent race condition laravel 11 [duplicate]
I have a table named gym_sessions it has user_id | status columns.
status column can contains: 1 ==> active; 2 ==> completed; 3 ==> declined;
Conditions:
User must have sufficient balance to ...
0
votes
0
answers
27
views
MySql CTE/recursive relationship query
I have these tables:
products (infinitely nested)
id
parent_id
links:
id
product_id
user_follows_link
user_id
linkd_id
I would like to write a query that returns the products that have links ...
0
votes
0
answers
72
views
Laravel Auth::user() is extremely slow (2.7s query time) how to optimize it? [duplicate]
I am experiencing an extremely slow query when calling Auth::user() in Laravel. The query takes around 2.7 seconds, which significantly slows down my application.
I logged the database queries using ...
0
votes
0
answers
33
views
Laravel SQLSTATE[HY093]: Invalid parameter number" but query works? [duplicate]
I'm new to Laravel but I'm trying to query locations based on bounding box of google map. When I run the page I get the following error:
"SQLSTATE[HY093]: Invalid parameter number (SQL: select `...
0
votes
0
answers
23
views
laravel application with proxysql and mysql8 say NO_AUTO_CREATE_USER [duplicate]
I have mysql group replication and proxysql, now when I connect multiple laravel projects with proxysql they all say SQLSTATE[42000]: Syntax error or access violation: 1231 Variable 'sql_mode' can't ...
0
votes
1
answer
82
views
Why does database keep dropping when running MySQL in container?
For context I am running a PHP Laravel web app using Laravel Sail on a digital ocean droplet with 2GB memory.
The problem I'm running into is that after running for a certain amount of time (seems ...
0
votes
1
answer
125
views
Tenancy for Laravel v3 not creating database
I need separate databases for each deployments (tenants).
public function store(Request $request)
{
Log::info("Starting deployment creation for slug: " . $request->slug);
// **...
0
votes
1
answer
76
views
How to Fetch Chat Data Using Eloquent with Joins?
I'm trying to fetch chat-related data using Eloquent in Laravel 11 but I'm struggling to structure an optimized query using Eloquent relationships or joins.
I have two MySQL tables:
users -> id, ...
1
vote
1
answer
61
views
Laravel Database Connections Not Closing with Apache2 on AWS ALB (EC2 Target Group)
I'm running a Laravel application hosted on an AWS EC2 instance, using Apache2 as the web server. The setup includes an AWS Application Load Balancer (ALB) directing traffic to the EC2 instance.
Issue:...
1
vote
1
answer
47
views
Laravel 8 Multiple Image Upload and store in mysql
I need to store image in DB and folder , but my code store only one image and I want to store multiple image . I use Laravel 8.
This is my controller
public function store(Request $request)
{
$...
0
votes
0
answers
109
views
Serialization deadlock on upsert in Laravel with concurrent console commands
I need some help improving the performance of my Laravel 11 upsert query. I'm pulling thousands of entries in chunks from a Redis 7 stream and upserting into my MySQL 8 database. It's an aggregated ...