You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SQLSTATE[42803]: Grouping error: 7 ERROR: column "participants.id" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: select * from "threads" where exists (select * from "partici...
^ (SQL: select * from "threads" where exists (select * from "participants" where "participants"."thread_id" = "threads"."id" and "user_id" in (2, 1) and "participants"."deleted_at" is null group by "thread_id" having COUNT(thread_id)=2) and "threads"."deleted_at" is null limit 1)
SQLSTATE[42803]: Grouping error: 7 ERROR: column "participants.id" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: select * from "threads" where exists (select * from "partici...
^
Code:
in MessagesController
public function show($username){
$user = User::where('username', $username)->first();
$authUser = \Auth::user();
if(! $user)
abort(404, 'user not found');
if($thread = Thread::Between([$user->id, $authUser->id])->first())
$thread->load(['participants', 'messages.user']);
return view('messages.show', compact('thread', 'user'));
}
Environment:
Laravel 5.3
Postgres SQL server on Amazon AWS
Local environment on Laravel Homestead with everything updated to the latest version
cmgmyr/laravel-messenger: ^2.13
Works on mysql but with only strict mode disabled.
How to replicate the error?
Change the database to postgres in .env file and provide the necessary credentials.
run the migrations
Use the Scope Between on Thread class.
The text was updated successfully, but these errors were encountered:
@suchal thanks for reporting this, and all of the additional details - it's certainly helpful. I'm still looking into this but hopefully should have a solution soon.
Error:
Code:
in
MessagesController
Environment:
How to replicate the error?
Between
onThread
class.The text was updated successfully, but these errors were encountered: