original_string: public function options()
      {
          if (request()->has('language')) {
              $pages = HCPagesTranslations::select('record_id as id', 'title', 'language_code')
                  ->where('language_code', request('language'));
  
              if (request()->has('type')) {
                  $pages->whereHas('record', function ($query) {
                      $query->where('type', strtoupper(request('type')));
                  });
              }
  
              if (request()->has('q')) {
                  $pages->where('title', 'LIKE', '%' . request('q') . '%');
              }
  
              return $pages->get();
          }
  
          return [];
      }
code: public function options()
      {
          if (request()->has('language')) {
              $pages = HCPagesTranslations::select('record_id as id', 'title', 'language_code')
                  ->where('language_code', request('language'));
  
              if (request()->has('type')) {
                  $pages->whereHas('record', function ($query) {
                      $query->where('type', strtoupper(request('type')));
                  });
              }
  
              if (request()->has('q')) {
                  $pages->where('title', 'LIKE', '%' . request('q') . '%');
              }
  
              return $pages->get();
          }
  
          return [];
      }
code_tokens: public function options ( ) { if ( request ( ) -> has ( 'language' ) ) { $ pages = HCPagesTranslations :: select ( 'record_id as id' , 'title' , 'language_code' ) -> where ( 'language_code' , request ( 'language' ) ) ; if ( request ( ) -> has ( 'type' ) ) { $ pages -> whereHas ( 'record' , function ( $ query ) { $ query -> where ( 'type' , strtoupper ( request ( 'type' ) ) ) ; } ) ; } if ( request ( ) -> has ( 'q' ) ) { $ pages -> where ( 'title' , 'LIKE' , '%' . request ( 'q' ) . '%' ) ; } return $ pages -> get ( ) ; } return [ ] ; }
docstring: Get options by request data
  
  @return array
docstring_tokens: Get options by request data