Created a livewire component
This commit is contained in:
parent
e6c875de3a
commit
25d3af87e8
13
app/Livewire/LikePost.php
Normal file
13
app/Livewire/LikePost.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire;
|
||||
|
||||
use Livewire\Component;
|
||||
|
||||
class LikePost extends Component
|
||||
{
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.like-post');
|
||||
}
|
||||
}
|
@ -10,6 +10,8 @@
|
||||
@stack('styles')
|
||||
|
||||
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
||||
|
||||
@livewireStyles
|
||||
</head>
|
||||
|
||||
<body class="bg-gray-100">
|
||||
@ -62,6 +64,8 @@
|
||||
DevStagram - {{ date('Y') }} All rights reserved.
|
||||
</footer>
|
||||
|
||||
@livewireScripts
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
3
resources/views/livewire/like-post.blade.php
Normal file
3
resources/views/livewire/like-post.blade.php
Normal file
@ -0,0 +1,3 @@
|
||||
<div>
|
||||
<h1>Hello, World!</h1>
|
||||
</div>
|
@ -12,6 +12,8 @@
|
||||
<div class="p-3 flex items-center gap-4">
|
||||
@auth
|
||||
|
||||
<livewire:like-post />
|
||||
|
||||
@if ($post->checkLike(auth()->user()))
|
||||
<form method="POST" action="{{ route('posts.likes.destroy', $post) }}">
|
||||
@csrf
|
||||
|
Loading…
x
Reference in New Issue
Block a user