From bf30235e1d5b83cc537c5a40acecf7a17de83d83 Mon Sep 17 00:00:00 2001 From: Paul Couture Date: Thu, 21 Dec 2023 15:31:06 -0600 Subject: [PATCH] fix: allowing users to change artist display name. --- site/app/Http/Controllers/ArtistController.php | 2 ++ .../views/profile/partials/update-location-form.blade.php | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/site/app/Http/Controllers/ArtistController.php b/site/app/Http/Controllers/ArtistController.php index 9460daa..0827d6e 100644 --- a/site/app/Http/Controllers/ArtistController.php +++ b/site/app/Http/Controllers/ArtistController.php @@ -107,6 +107,7 @@ public function update(Request $request, Artist $artist) 'alby' => ['email'], 'website' => ['url'], 'nasocial' => ['starts_with:@'], + 'name' => ['string', 'unique:artists', 'max:255'], ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { @@ -118,6 +119,7 @@ public function update(Request $request, Artist $artist) $artist->alby = $request->alby; $artist->website = $request->website; $artist->nasocial = $request->nasocial; + $artist->name = $request->name; if ($artist->isDirty()) { $artist->save(); } diff --git a/site/resources/views/profile/partials/update-location-form.blade.php b/site/resources/views/profile/partials/update-location-form.blade.php index bcbe9de..741cf6f 100644 --- a/site/resources/views/profile/partials/update-location-form.blade.php +++ b/site/resources/views/profile/partials/update-location-form.blade.php @@ -13,6 +13,11 @@
@csrf +
+ + + +