Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions app/Http/Livewire/Discussions/Comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use App\Models\Reply;
use Filament\Notifications\Notification;
use Illuminate\Contracts\View\View;
use Illuminate\Support\Facades\Auth;
use Livewire\Component;

class Comment extends Component
Expand All @@ -29,6 +30,16 @@ public function delete(): void

public function toggleLike(): void
{
if (! Auth::check()) {
Notification::make()
->title(__('Vous devez être connecté pour liker un commentaire.'))
->danger()
->duration(5000)
->send();

return;
}

LikeReply::run(auth()->user(), $this->comment);

$this->emitSelf('reloadComment');
Expand Down