mirror of
https://github.com/NyaaStudios/nyaabooru.git
synced 2025-12-10 05:42:58 +00:00
Add tag & tag group creation
This commit is contained in:
parent
f64afa649a
commit
f2950ec7eb
15 changed files with 330 additions and 22 deletions
|
|
@ -4,6 +4,8 @@ namespace App\Http\Controllers;
|
|||
|
||||
use App\Models\Comment;
|
||||
use App\Models\Post;
|
||||
use App\Models\Tag;
|
||||
use App\Models\TagGroup;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
|
|
@ -28,4 +30,20 @@ class DeletionController extends Controller
|
|||
$post->delete();
|
||||
return redirect()->route('posts.home');
|
||||
}
|
||||
|
||||
public function deleteTag(Tag $tag)
|
||||
{
|
||||
$tag->delete();
|
||||
return redirect()->route('tags.home');
|
||||
}
|
||||
|
||||
public function deleteTagGroup(TagGroup $tagGroup)
|
||||
{
|
||||
foreach ($tagGroup->tags as $tag)
|
||||
{
|
||||
$tag->delete();
|
||||
}
|
||||
$tagGroup->delete();
|
||||
return redirect()->route('tags.groups');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue