mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Delete tags
This commit is contained in:
@@ -39,6 +39,37 @@ class TagController extends Controller
|
||||
View::share('tagOptions', $tagOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Tag $tag
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function delete(Tag $tag)
|
||||
{
|
||||
$subTitle = 'Delete "' . e($tag->tag) . '"';
|
||||
|
||||
// put previous url in session
|
||||
Session::put('tags.delete.url', URL::previous());
|
||||
|
||||
return view('tags.delete', compact('tag', 'subTitle'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Tag $tag
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function destroy(Tag $tag, TagRepositoryInterface $repository)
|
||||
{
|
||||
|
||||
$tagName = $tag->tag;
|
||||
$repository->destroy($tag);
|
||||
|
||||
Session::flash('success', 'Tag "' . e($tagName) . '" was deleted.');
|
||||
|
||||
return Redirect::to(route('tags.index'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
|
Reference in New Issue
Block a user