original_string: public function index()
      {
          $templates = IncidentTemplate::query();
  
          if ($sortBy = Binput::get('sort')) {
              $direction = Binput::has('order') && Binput::get('order') == 'desc';
  
              $templates->sort($sortBy, $direction);
          }
  
          $templates = $templates->paginate(Binput::get('per_page', 20));
  
          return $this->paginator($templates, Request::instance());
      }
code: public function index()
      {
          $templates = IncidentTemplate::query();
  
          if ($sortBy = Binput::get('sort')) {
              $direction = Binput::has('order') && Binput::get('order') == 'desc';
  
              $templates->sort($sortBy, $direction);
          }
  
          $templates = $templates->paginate(Binput::get('per_page', 20));
  
          return $this->paginator($templates, Request::instance());
      }
code_tokens: public function index ( ) { $ templates = IncidentTemplate :: query ( ) ; if ( $ sortBy = Binput :: get ( 'sort' ) ) { $ direction = Binput :: has ( 'order' ) && Binput :: get ( 'order' ) == 'desc' ; $ templates -> sort ( $ sortBy , $ direction ) ; } $ templates = $ templates -> paginate ( Binput :: get ( 'per_page' , 20 ) ) ; return $ this -> paginator ( $ templates , Request :: instance ( ) ) ; }
docstring: Get all incident templates.
  
  @return \Illuminate\Http\JsonResponse
docstring_tokens: Get all incident templates .