Skip to content

Commit

Permalink
Update comment validation message and error handling in CommentContro…
Browse files Browse the repository at this point in the history
…ller.php and task.blade.php
  • Loading branch information
Ortiix85 committed Jan 21, 2024
1 parent 5b1018f commit 625e025
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/CommentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function store(Request $request, $id)
$validatedData = $request->validate([
'content' => 'required|string|max:500',
], [
'content.max' => 'La taille du commentaire ne doit pas dépasser :max caractères.',
'content.max' => 'The comment size must not exceed 500 characters.',
]);

$user = AuthUtil::getAuthUser();
Expand Down
5 changes: 4 additions & 1 deletion resources/views/app/task.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
<textarea class="w-full outline-none bg-gray-100 min-h-25 resize-none rounded-2xl p-2 " id="content" name="content" rows="3" placeholder="Write your comment here..."></textarea>

<div class="flex flex-row justify-end items-center">
@error("content")
{{ $message }}
@enderror
<button class="bg-red rounded-xl px-4 py-1 font-semibold text-white">
<div class="flex justify-center items-center gap-2">
<x-icons.send size=20/>
Expand All @@ -61,7 +64,7 @@
</div>
<div class="flex w-[42rem] flex-col gap-2 justify-start items-start mt-4">
<p class="font-semibold">Comments :</p>
<div class="w-full flex flex-col justify-start p-3 items-start gap-4 max-h-80 overflow-y-auto">
<div class="w-full flex flex-col justify-start p-3 items-start gap-4">
@foreach ($comments as $comment)
<x-task.commentary :comment="$comment"></x-task.commentary>
@endforeach
Expand Down

0 comments on commit 625e025

Please sign in to comment.