Answers for "laravel get unique values from collection"

PHP
1

get unique values in laravel

$users = User::select('name')->distinct()->get();
Posted by: Guest on February-19-2021
0

laravel collection unique

$collection = collect([1, 1, 2, 2, 3, 4, 2]);

$unique = $collection->unique();

$unique->values()->all();

// [1, 2, 3, 4]
Posted by: Guest on July-24-2021
0

laravel rule unique where

'required|email|unique:company_users,email_address,NULL,id,company_id,' . $request->company_id
Posted by: Guest on October-09-2020
0

laravel collection unique

$users = $users->unique();
Posted by: Guest on July-24-2021

Code answers related to "laravel get unique values from collection"

Browse Popular Code Answers by Language