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