private function getActionsOnResources($config)
    {
        $result = [];

        $resources = (array) Collection::get($config, 'resources', []);
        $actions = (array) Collection::get($config, 'actions', []);
        if (!isset($actions[0]) || !is_array($actions[0])) {
            $actions = [$actions];
        }

        $index = 0;
        foreach ($resources as $resource) {
            if ('!' === substr($resource, 0, 1)) {
                $resource = substr($resource, 1);
                $result[$resource] = [];
                continue;
            }

            $action = isset($actions[$index]) ? $actions[$index] : $actions[0];
            $result[$resource] = $this->getActions($action);
        }

        return $result;
    }
private function getActionsOnResources($config)
    {
        $result = [];

        $resources = (array) Collection::get($config, 'resources', []);
        $actions = (array) Collection::get($config, 'actions', []);
        if (!isset($actions[0]) || !is_array($actions[0])) {
            $actions = [$actions];
        }

        $index = 0;
        foreach ($resources as $resource) {
            if ('!' === substr($resource, 0, 1)) {
                $resource = substr($resource, 1);
                $result[$resource] = [];
                continue;
            }

            $action = isset($actions[$index]) ? $actions[$index] : $actions[0];
            $result[$resource] = $this->getActions($action);
        }

        return $result;
    }
private function getActionsOnResources ( $ config ) { $ result = [ ] ; $ resources = ( array ) Collection :: get ( $ config , 'resources' , [ ] ) ; $ actions = ( array ) Collection :: get ( $ config , 'actions' , [ ] ) ; if ( ! isset ( $ actions [ 0 ] ) || ! is_array ( $ actions [ 0 ] ) ) { $ actions = [ $ actions ] ; } $ index = 0 ; foreach ( $ resources as $ resource ) { if ( '!' === substr ( $ resource , 0 , 1 ) ) { $ resource = substr ( $ resource , 1 ) ; $ result [ $ resource ] = [ ] ; continue ; } $ action = isset ( $ actions [ $ index ] ) ? $ actions [ $ index ] : $ actions [ 0 ] ; $ result [ $ resource ] = $ this -> getActions ( $ action ) ; } return $ result ; }
Format actions on resources.

@param  array $config

@return array
Format actions on resources .