laravel-database-encryption icon indicating copy to clipboard operation
laravel-database-encryption copied to clipboard

Not working with join()

Open n-o-o-b-z opened this issue 2 years ago • 3 comments

It is not working using laravel join()

n-o-o-b-z avatar Jan 26 '23 01:01 n-o-o-b-z

Same have you find any solution ?

Onkar-php-digi avatar Feb 08 '23 07:02 Onkar-php-digi

not yet, I'm still waiting, how about you?

n-o-o-b-z avatar Feb 08 '23 14:02 n-o-o-b-z

I have sorted it with Laravel relations, and it works fine for me.

$data_message = []; $results = Message::with(['fromUser' => function ($query) { $query->select('id', 'name', 'email', 'image'); }]) ->where('to_user_id', $user_id) ->where('is_read',0) // ->groupBy('from_user_id') ->orderBy('id','DESC') ->get(); $results = $results->unique('from_user_id');

Onkar-php-digi avatar Feb 08 '23 19:02 Onkar-php-digi