set default first/last name

This commit is contained in:
2023-05-08 12:20:57 +10:00
parent 2698ede55e
commit 890399dd74

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->string('first_name')->default('')->change();
$table->string('last_name')->default('')->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->string('first_name')->nullable(false)->change();
$table->string('last_name')->nullable(false)->change();
});
}
};