Skip to content

Conversation

SychO9
Copy link
Contributor

@SychO9 SychO9 commented May 10, 2024

We have a use case where we need to enable linkage for a ToMany relation, but only when the Show endpoint is related to the resource itself and not another (another can be when inclusion is in effect instead).

So we do something along the lines of

ToMany::make('posts')
    ->withLinkage(function (Context $context) {
          return $context->showing(self::class);
     })

@tobyzerner tobyzerner merged commit ffc7d7f into tobyzerner:main Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants