You don't want to use auto incrementing ID in your model? Since Laravel 9, it's very easy to implement UUIDs.
Migration:
Schema::create('users', function (Blueprint $table) { // $table->increments('id'); $table->uuid('id')->unique();});
Model:
use Illuminate\Database\Eloquent\Concerns\HasUuids;use Illuminate\Database\Eloquent\Model; class Article extends Model{ use HasUuids; // ...}
Controller:
$article = Article::create(['title' => 'Traveling to Europe']); $article->id; // "8f8e8478-9035-4d23-b9a7-62f4d2612ce5"