Answers for "generate unique number in laravel"

PHP
1

get unique values in laravel

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

Laravel Generate Random Unique Number Example

<?php
  
namespace App\Http\Controllers;
  
class TestController extends Controller
{
    /**
     * Write code on Method
     *
     * @return response()
     */
    public function index()
    {
        $randomNumber = random_int(1000, 9999);
  
        dd($randomNumber);
    }
}
Posted by: Guest on August-30-2021

Code answers related to "generate unique number in laravel"

Browse Popular Code Answers by Language