mirror of
https://github.com/NyaaStudios/nyaabooru.git
synced 2025-12-09 21:42:57 +00:00
add tags to posts
This commit is contained in:
parent
2f95117389
commit
c77c97be2d
5 changed files with 26 additions and 3 deletions
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 = '';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue