public function store(TagRequest $request) { if (Gate::denies('store-tag')) { abort(403); } $tag = new Tag(); $tag->name = $request->input('name'); $tag->save(); return $tag; }
public function queryTag(Request $request) { $queryTagName = $request->input('name'); $tags = Tag::where('name', 'like', '%' . $queryTagName . '%')->get(); return $tags; }