Created
October 7, 2022 08:44
-
-
Save ibayazit/fbe2100c679295b1b631e29f0171c67f to your computer and use it in GitHub Desktop.
Laravel uuid migration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
... | |
use Illuminate\Database\Query\Expression; | |
... | |
return new class extends Migration | |
{ | |
/** | |
* Run the migrations. | |
* | |
* @return void | |
*/ | |
public function up() | |
{ | |
Schema::create('users', function (Blueprint $table) { | |
$table->uuid('id')->primary()->unique()->default(new Expression('(UUID())')); | |
... | |
}); | |
} | |
... | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment