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;
    }
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;
    }
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 ; }
Define abilities for a resource.

@param  string  $name
@param  string  $class
@param  array|null   $abilities
@return $this
Define abilities for a resource .