1 <?php namespace BookStack\Http\Controllers;
3 use BookStack\Actions\TagRepo;
4 use Illuminate\Http\Request;
6 class TagController extends Controller
12 * TagController constructor.
14 public function __construct(TagRepo $tagRepo)
16 $this->tagRepo = $tagRepo;
17 parent::__construct();
21 * Get tag name suggestions from a given search term.
23 public function getNameSuggestions(Request $request)
25 $searchTerm = $request->get('search', null);
26 $suggestions = $this->tagRepo->getNameSuggestions($searchTerm);
27 return response()->json($suggestions);
31 * Get tag value suggestions from a given search term.
33 public function getValueSuggestions(Request $request)
35 $searchTerm = $request->get('search', null);
36 $tagName = $request->get('name', null);
37 $suggestions = $this->tagRepo->getValueSuggestions($searchTerm, $tagName);
38 return response()->json($suggestions);