original_string: public function index($params = [])
      {
          // Set the filters
          $params = (!empty($params))? $params : $this->app->request->input();
  
          // Get records
          $this->model->params = $params;
          $result = $this->model->search($params)->get();
  
          // Get pagination and number of records
          $pagination = array_merge(
              ['records' => $this->model->search($params)->count()],
              $this->model->pagination()
          );
  
          // Return results
          return [
              'success' => true,
              'paging' => $pagination,
              'data' => $result
          ];
      }
code: public function index($params = [])
      {
          // Set the filters
          $params = (!empty($params))? $params : $this->app->request->input();
  
          // Get records
          $this->model->params = $params;
          $result = $this->model->search($params)->get();
  
          // Get pagination and number of records
          $pagination = array_merge(
              ['records' => $this->model->search($params)->count()],
              $this->model->pagination()
          );
  
          // Return results
          return [
              'success' => true,
              'paging' => $pagination,
              'data' => $result
          ];
      }
code_tokens: public function index ( $ params = [ ] ) { // Set the filters $ params = ( ! empty ( $ params ) ) ? $ params : $ this -> app -> request -> input ( ) ; // Get records $ this -> model -> params = $ params ; $ result = $ this -> model -> search ( $ params ) -> get ( ) ; // Get pagination and number of records $ pagination = array_merge ( [ 'records' => $ this -> model -> search ( $ params ) -> count ( ) ] , $ this -> model -> pagination ( ) ) ; // Return results return [ 'success' => true , 'paging' => $ pagination , 'data' => $ result ] ; }
docstring: Display a listing of the resource
  
  @param array $params Listing parameters
  @return array Response
docstring_tokens: Display a listing of the resource