public function checkResource($resource)
    {
        $resource =
            $resource instanceof Resource
                ? $resource
                : $this->getResourceBySlug($resource);

        $checked = $this->cache->remember($resource->slug, function () use (
            $resource
        ) {
            return $resource->check($this->getCurrentAction());
        });

        $resource->targets = $checked->targets;

        return $resource;
    }
public function checkResource($resource)
    {
        $resource =
            $resource instanceof Resource
                ? $resource
                : $this->getResourceBySlug($resource);

        $checked = $this->cache->remember($resource->slug, function () use (
            $resource
        ) {
            return $resource->check($this->getCurrentAction());
        });

        $resource->targets = $checked->targets;

        return $resource;
    }
public function checkResource ( $ resource ) { $ resource = $ resource instanceof Resource ? $ resource : $ this -> getResourceBySlug ( $ resource ) ; $ checked = $ this -> cache -> remember ( $ resource -> slug , function ( ) use ( $ resource ) { return $ resource -> check ( $ this -> getCurrentAction ( ) ) ; } ) ; $ resource -> targets = $ checked -> targets ; return $ resource ; }
Check a resource.

@param $resource
@return array
@throws Exception
Check a resource .