original_string: public function resource($name, $class, array $abilities = null)
      {
          $abilities = $abilities ?: [
              'view'   => 'view',
              'create' => 'create',
              'update' => 'update',
              'delete' => 'delete',
          ];
  
          foreach ($abilities as $ability => $method) {
              $this->define($name.'.'.$ability, $class.'@'.$method);
          }
  
          return $this;
      }
code: public function resource($name, $class, array $abilities = null)
      {
          $abilities = $abilities ?: [
              'view'   => 'view',
              'create' => 'create',
              'update' => 'update',
              'delete' => 'delete',
          ];
  
          foreach ($abilities as $ability => $method) {
              $this->define($name.'.'.$ability, $class.'@'.$method);
          }
  
          return $this;
      }
code_tokens: public function resource ( $ name , $ class , array $ abilities = null ) { $ abilities = $ abilities ? : [ 'view' => 'view' , 'create' => 'create' , 'update' => 'update' , 'delete' => 'delete' , ] ; foreach ( $ abilities as $ ability => $ method ) { $ this -> define ( $ name . '.' . $ ability , $ class . '@' . $ method ) ; } return $ this ; }
docstring: Define abilities for a resource.
  
  @param  string  $name
  @param  string  $class
  @param  array|null   $abilities
  @return $this
docstring_tokens: Define abilities for a resource .