From 3509098bbc87440ed8b314f5e432f85ea14fa60f Mon Sep 17 00:00:00 2001 From: ttimot24 Date: Thu, 14 Nov 2024 14:34:13 +0100 Subject: [PATCH] Improved user feedback on blogpost forms --- app/Libs/PluginManager.php | 7 ++++++- app/Model/Blogpost.php | 1 + app/View/blogposts/form.blade.php | 34 +++++++++++++++++++++---------- app/View/users/form.blade.php | 10 +++++++-- 4 files changed, 38 insertions(+), 14 deletions(-) diff --git a/app/Libs/PluginManager.php b/app/Libs/PluginManager.php index 7e44dc7ed..50baf737e 100644 --- a/app/Libs/PluginManager.php +++ b/app/Libs/PluginManager.php @@ -2,9 +2,14 @@ namespace App\Libs; +/** + * @deprecated deprecated since version 1.0.0 + */ class PluginManager extends Model{ - + /** + * @deprecated deprecated since version 1.0.0 + */ public static function area($area_num){ foreach(app()->plugins as $widget){ diff --git a/app/Model/Blogpost.php b/app/Model/Blogpost.php index 6f582a5bf..31c77194e 100644 --- a/app/Model/Blogpost.php +++ b/app/Model/Blogpost.php @@ -29,6 +29,7 @@ class Blogpost extends Model public static $rules = [ 'title' => 'required', + 'summary' => 'max:255', 'category_id' => 'required' ]; diff --git a/app/View/blogposts/form.blade.php b/app/View/blogposts/form.blade.php index 2536c9a77..c02bb2bdf 100644 --- a/app/View/blogposts/form.blade.php +++ b/app/View/blogposts/form.blade.php @@ -21,14 +21,20 @@
-
- - + + + + @error('title') + + {{ $errors->first('title') }} + + @enderror
-
- +
+
-
- -
+
+ + +
+ + @error('summary') + + {{ $errors->first('summary') }} + + @enderror
@@ -57,7 +69,7 @@ @endif
- +
- +
-
@@ -61,8 +61,14 @@ class="form-control @error('password') is-invalid @enderror"
- + + @error('email') + + {{ $errors->first('email') }} + + @enderror