relation; } /** * Get the type of the relation. */ public function getType(): string { return Str::of($this->getRelation())->explode('.')->last(); } /** * Determine if the provided scope is within this scope. */ public function isWithinScope(Scope $scope): bool { return $scope instanceof RelationScope && $this->relation === $scope->getRelation(); } }