Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relationship meta #28

Open
tobyzerner opened this issue May 25, 2021 · 0 comments
Open

Relationship meta #28

tobyzerner opened this issue May 25, 2021 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@tobyzerner
Copy link
Owner

tobyzerner commented May 25, 2021

eg. pivot timestamps/data

ToMany::make('roles')
    // meta on the relationship object
    // $context->model is still the parent model
    ->meta([
        Meta::make('foo')->get('bar'),
    ])

    // meta on linkage resource identifier objects
    // $context->model is the related model
    ->linkageMeta([
        Meta::make('assignedAt')->get(fn($role) => $role->pivot->created_at),
    ]);
@tobyzerner tobyzerner added the enhancement New feature or request label May 25, 2021
@tobyzerner tobyzerner added this to the v1.1 milestone Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant