diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 524be45..aa1530c 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -30,11 +30,12 @@ class UserController extends Controller 'min:64', //function ($attribute,$value,$fail) { return $fail('Not this time'); } ], + 'alias' => 'nullable|min:1', 'active' => 'required|boolean', 'admin' => 'required|boolean', ]); - foreach (['name','email','pgp_pubkey','active','admin'] as $key) + foreach (['name','email','pgp_pubkey','active','admin','alias'] as $key) $o->{$key} = $request->post($key); if (! $o->exists) diff --git a/database/migrations/2021_10_19_105854_add_alias_to_user.php b/database/migrations/2021_10_19_105854_add_alias_to_user.php new file mode 100644 index 0000000..026e056 --- /dev/null +++ b/database/migrations/2021_10_19_105854_add_alias_to_user.php @@ -0,0 +1,32 @@ +string('alias')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('users', function (Blueprint $table) { + $table->dropColumn('alias'); + }); + } +} diff --git a/resources/views/user/addedit.blade.php b/resources/views/user/addedit.blade.php index 0b5ac83..a3f2769 100644 --- a/resources/views/user/addedit.blade.php +++ b/resources/views/user/addedit.blade.php @@ -29,16 +29,16 @@ -
- -
-
- active))checked @endif> - - - active))checked @endif> - -
+
+ +
+ + + + @error('alias') + {{ $message }} + @enderror +
@@ -59,7 +59,20 @@
-
+
+ +
+
+ active))checked @endif> + + + active))checked @endif> + +
+
+
+ +
id == $o->id)data-bs-toggle="tooltip" title="You cannot demote yourself" @endif>