From fb07c3bb533d7ffd622d2a55ed7284c591c9249a Mon Sep 17 00:00:00 2001 From: alex-chevski Date: Thu, 14 Dec 2023 14:00:50 +0300 Subject: [PATCH] update reviews comments --- app/Livewire/Plan/Comment/Create.php | 6 +++ .../livewire/plan/comment/create.blade.php | 38 ++++++++----------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/app/Livewire/Plan/Comment/Create.php b/app/Livewire/Plan/Comment/Create.php index 26b029b..cf89e2c 100644 --- a/app/Livewire/Plan/Comment/Create.php +++ b/app/Livewire/Plan/Comment/Create.php @@ -6,6 +6,7 @@ use Livewire\Component; use App\Models\Plan; use App\Models\PlanComment; use App\Models\User; +use Livewire\Attributes\Validate; class Create extends Component { @@ -21,6 +22,11 @@ class Create extends Component public function save() { + $this->validate([ + 'body' => 'required|min:10', + 'grade' => 'required', + ]); + $comment = new PlanComment(); $comment->grade = $this->grade; $comment->body = $this->body; diff --git a/resources/views/livewire/plan/comment/create.blade.php b/resources/views/livewire/plan/comment/create.blade.php index 8873d7e..08bfe13 100644 --- a/resources/views/livewire/plan/comment/create.blade.php +++ b/resources/views/livewire/plan/comment/create.blade.php @@ -1,24 +1,18 @@ -
-