From a7c3c95d8e085e43c5a4dce7bf2d2bbd34eadcc3 Mon Sep 17 00:00:00 2001 From: Ghostie Date: Mon, 19 Aug 2024 19:16:03 -0500 Subject: [PATCH] created a migration --- app/Http/Controllers/SignupController.php | 2 +- ..._20_001220_add_username_to_users_table.php | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 database/migrations/2024_08_20_001220_add_username_to_users_table.php diff --git a/app/Http/Controllers/SignupController.php b/app/Http/Controllers/SignupController.php index 4bb8b74..aef791d 100644 --- a/app/Http/Controllers/SignupController.php +++ b/app/Http/Controllers/SignupController.php @@ -18,7 +18,7 @@ class SignupController extends Controller "name" => "required|max:16", "username" => "required|unique:users|min:3|max:16", "email" => "required|unique:users|email|max:64", - "password" => "required|min:8|max:64", + "password" => "required|min:8|max:64|confirmed", ]); } } diff --git a/database/migrations/2024_08_20_001220_add_username_to_users_table.php b/database/migrations/2024_08_20_001220_add_username_to_users_table.php new file mode 100644 index 0000000..3495615 --- /dev/null +++ b/database/migrations/2024_08_20_001220_add_username_to_users_table.php @@ -0,0 +1,28 @@ +string("username"); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('users', function (Blueprint $table) { + $table->dropColumn("username"); + }); + } +};