diff --git a/app/Http/Controllers/DeletionController.php b/app/Http/Controllers/DeletionController.php
index 0adadf1..80eb5bb 100644
--- a/app/Http/Controllers/DeletionController.php
+++ b/app/Http/Controllers/DeletionController.php
@@ -46,4 +46,10 @@ class DeletionController extends Controller
$tagGroup->delete();
return redirect()->route('tags.groups');
}
+
+ public function deletePostTag(Post $post, Tag $tag)
+ {
+ $post->tags()->detach($tag);
+ return redirect("/posts/$post->id/edit");
+ }
}
diff --git a/app/Livewire/Posts/Edit.php b/app/Livewire/Posts/Edit.php
index cd448f3..d6d1838 100644
--- a/app/Livewire/Posts/Edit.php
+++ b/app/Livewire/Posts/Edit.php
@@ -4,15 +4,14 @@ namespace App\Livewire\Posts;
use App\Models\Post;
use App\Models\Tag;
-use Illuminate\Database\Eloquent\Collection;
use Livewire\Attributes\Validate;
use Livewire\Component;
class Edit extends Component
{
public Post $post;
- public Collection $tags;
- public Collection $selectableTags;
+ public $tags;
+ public $selectableTags;
#[Validate('exists:tags,id')]
public string $tag = '';
diff --git a/resources/views/livewire/posts/edit.blade.php b/resources/views/livewire/posts/edit.blade.php
index a36c87e..287d43f 100644
--- a/resources/views/livewire/posts/edit.blade.php
+++ b/resources/views/livewire/posts/edit.blade.php
@@ -24,6 +24,12 @@
Feature post
@endif
+
+