From 25d3af87e85e411f1c0a2661e53e20aa2ac2cb5b Mon Sep 17 00:00:00 2001 From: Ghostie Date: Fri, 23 Aug 2024 19:49:55 -0500 Subject: [PATCH] Created a livewire component --- app/Livewire/LikePost.php | 13 +++++++++++++ resources/views/layouts/app.blade.php | 4 ++++ resources/views/livewire/like-post.blade.php | 3 +++ resources/views/posts/show.blade.php | 2 ++ 4 files changed, 22 insertions(+) create mode 100644 app/Livewire/LikePost.php create mode 100644 resources/views/livewire/like-post.blade.php diff --git a/app/Livewire/LikePost.php b/app/Livewire/LikePost.php new file mode 100644 index 0000000..421d9ee --- /dev/null +++ b/app/Livewire/LikePost.php @@ -0,0 +1,13 @@ + @@ -62,6 +64,8 @@ DevStagram - {{ date('Y') }} All rights reserved. + @livewireScripts + diff --git a/resources/views/livewire/like-post.blade.php b/resources/views/livewire/like-post.blade.php new file mode 100644 index 0000000..2d26220 --- /dev/null +++ b/resources/views/livewire/like-post.blade.php @@ -0,0 +1,3 @@ +
+

Hello, World!

+
diff --git a/resources/views/posts/show.blade.php b/resources/views/posts/show.blade.php index d3659e4..bd729c8 100644 --- a/resources/views/posts/show.blade.php +++ b/resources/views/posts/show.blade.php @@ -12,6 +12,8 @@
@auth + + @if ($post->checkLike(auth()->user()))
@csrf