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;
20 * Get tag name suggestions from a given search term.
22 public function getNameSuggestions(Request $request)
24 $searchTerm = $request->get('search', null);
25 $suggestions = $this->tagRepo->getNameSuggestions($searchTerm);
26 return response()->json($suggestions);
30 * Get tag value suggestions from a given search term.
32 public function getValueSuggestions(Request $request)
34 $searchTerm = $request->get('search', null);
35 $tagName = $request->get('name', null);
36 $suggestions = $this->tagRepo->getValueSuggestions($searchTerm, $tagName);
37 return response()->json($suggestions);