Answers for "laravel get unique rows"

PHP
1

get unique values in laravel

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

laravel generate unique token

use Illuminate\Support\Str;

public function yourFunction(){
 $var = Str::random(32);

 dd($var);
}
Posted by: Guest on February-19-2020
0

laravel unique column except self

'required|unique:users,email,'.$this->id . ',user_id';
Posted by: Guest on December-16-2020

Browse Popular Code Answers by Language