src/Traits/ApiActions.php
public function autocomplete(FilterRequest $request)
    {
        $this->fieldManager = $this->getFieldManager();
        $this->validate($request->request, $this->fieldManager->autocomplete());
        
        $text = $request->request->get('text');
        
        $resources = $this->repository->filter($request)->autocomplete($text)->get();
        
        if ($resources->count() < 1) {
            // return $this->notFound();
        }
        
        return $this->success($resources);
    }
public function autocomplete(FilterRequest $request)
    {
        $this->fieldManager = $this->getFieldManager();
        $this->validate($request->request, $this->fieldManager->autocomplete());
        
        $text = $request->request->get('text');
        
        $resources = $this->repository->filter($request)->autocomplete($text)->get();
        
        if ($resources->count() < 1) {
            // return $this->notFound();
        }
        
        return $this->success($resources);
    }
Display a listing of the resource.

@return \Illuminate\Http\Response