src/Requests/PermissionRequest.php
public function rules()
    {
        $return = [
            'description' => 'required|max:255',
            'name' => 'required|max:255|unique:' .
                config('roleManager.permissionsTable') . ',name',
            'class' => 'classExist',
            'method' => 'required_with:class|methodExist'

        ];

        if (Request::isMethod('put')) {
            $permission = Permissions::where(
                'id', Request::route('permission')
            )->firstOrFail();
            if ($permission->name == Request::input('name')) {
                $return['name'] = 'required|max:255';
            }

        }
        return $return;
    }
public function rules()
    {
        $return = [
            'description' => 'required|max:255',
            'name' => 'required|max:255|unique:' .
                config('roleManager.permissionsTable') . ',name',
            'class' => 'classExist',
            'method' => 'required_with:class|methodExist'

        ];

        if (Request::isMethod('put')) {
            $permission = Permissions::where(
                'id', Request::route('permission')
            )->firstOrFail();
            if ($permission->name == Request::input('name')) {
                $return['name'] = 'required|max:255';
            }

        }
        return $return;
    }
Get the validation rules that apply to the request.

@return array