protected function authorizeResource($resource)
    {
        if ($this->isEditing($resource)) {
            return $this->user()->can($resource . '.update');
        }

        return $this->user()->can($resource . '.create');
    }
protected function authorizeResource($resource)
    {
        if ($this->isEditing($resource)) {
            return $this->user()->can($resource . '.update');
        }

        return $this->user()->can($resource . '.create');
    }
protected function authorizeResource ( $ resource ) { if ( $ this -> isEditing ( $ resource ) ) { return $ this -> user ( ) -> can ( $ resource . '.update' ) ; } return $ this -> user ( ) -> can ( $ resource . '.create' ) ; }
Check if user is authorized to perform the action.

@param string $resource
@return bool
Check if user is authorized to perform the action .