laravel generate unique token

Solutions on MaxInterview for laravel generate unique token by the best coders in the world

showing results for - "laravel generate unique token"
Andrea
30 Nov 2018
1use Illuminate\Support\Str;
2
3public function yourFunction(){
4 $var = Str::random(32);
5
6 dd($var);
7}
Imran
12 Oct 2020
1do {
2    $token_id = makeRandomToken();
3    $token_key = makeRandomTokenKey();
4} while (User::where("token_id", "=", $token_id)->where("token_key", "=", $token_key)->first() instanceof User);