public function validatePermission(array $permission)
    {
        /** @var \Illuminate\Validation\Validator $validator */
        $validator = Validator::make($permission, $this->permissionValidationRules);

        if ($validator->passes()) {
            return true;
        }

        $message = "Invalid permission:\r\n".implode("\r\n", Arr::flatten($validator->errors()->messages()));

        throw new \Exception($message);
    }
public function validatePermission(array $permission)
    {
        /** @var \Illuminate\Validation\Validator $validator */
        $validator = Validator::make($permission, $this->permissionValidationRules);

        if ($validator->passes()) {
            return true;
        }

        $message = "Invalid permission:\r\n".implode("\r\n", Arr::flatten($validator->errors()->messages()));

        throw new \Exception($message);
    }
public function validatePermission ( array $ permission ) { /** @var \Illuminate\Validation\Validator $validator */ $ validator = Validator :: make ( $ permission , $ this -> permissionValidationRules ) ; if ( $ validator -> passes ( ) ) { return true ; } $ message = "Invalid permission:\r\n" . implode ( "\r\n" , Arr :: flatten ( $ validator -> errors ( ) -> messages ( ) ) ) ; throw new \ Exception ( $ message ) ; }
Validate permission fields.

@param array $permission

@throws \Exception

@return bool
Validate permission fields .