From 7fb6068d49cc6134f02ad05f6f0ba773e928f6e0 Mon Sep 17 00:00:00 2001 From: Julian Prieber <60265788+JulianPrieber@users.noreply.github.com> Date: Fri, 18 Mar 2022 12:04:13 +0100 Subject: [PATCH] Made link title optional MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Made link title (previously required) optional when adding personal LittleLink links on the User/Admin Panel. If the 'Title' field is left empty, the button name is now used instead of rejecting the addition. --- app/Http/Controllers/UserController.php | 5 ++++- resources/views/studio/add-link.blade.php | 12 +++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 3885ab4..1ff621f 100755 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -60,11 +60,14 @@ class UserController extends Controller { $request->validate([ 'link' => 'required', - 'title' => 'required', + 'title' => '', 'button' => 'required' ]); $link = $request->link; + if ($request->title == '') + $title = $request->button; + else $title = $request->title; $button = $request->button; diff --git a/resources/views/studio/add-link.blade.php b/resources/views/studio/add-link.blade.php index 0305ac0..bfe608e 100755 --- a/resources/views/studio/add-link.blade.php +++ b/resources/views/studio/add-link.blade.php @@ -7,20 +7,26 @@
@csrf
- +
- +
- + +
+