Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel distinct not working

$messages = collect(Message::where('recipient_id', $user)->get());

    $messagesUnique = $messages->unique('recipient_id');

    $messagesUnique->values()->all();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #distinct #working
ADD COMMENT
Topic
Name
6+2 =