Mostly, one is for you query and the other is for Laravel authentication middleware to get the authenticated user.
Jul 21, 2023
2
Level 1
Laravel Eloquent issue with Mysql 8 | Laravel duplicate prepare statement
Laravel Eloquent query triggering duplicate prepare statement in Mysql 8.x Mysql General logs. For Example User::find(10); is triggering two prepare statement and one execute query in Mysql. But Mysql 5.x is working fine.
2023-07-21T08:27:06.028226Z 366 Prepare select * from users where users.id = ? and users.deleted_at is null limit 1
2023-07-21T08:27:06.028488Z 366 Prepare select * from users where users.id = ? and users.deleted_at is null limit 1
2023-07-21T08:27:06.028527Z 366 Execute select * from users where users.id = 17 and users.deleted_at is null limit 1
Please or to participate in this conversation.