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

Adding additional meta for resource when calling with ApiResource #413

Closed
090809 opened this issue Jan 23, 2022 · 0 comments · Fixed by #414
Closed

Adding additional meta for resource when calling with ApiResource #413

090809 opened this issue Jan 23, 2022 · 0 comments · Fixed by #414

Comments

@090809
Copy link

090809 commented Jan 23, 2022

Description

When I send response with Resource, sometimes I use ->additional() call for adding meta information for display, like:

return EventResource::make($event)->additional([
    'title' => __('Event created'),
    'message' => __('Event successful created'),
]);

with current realization we can't add additional field to metadata

Suggestion

Probably, we can extend @apiResourceCollection and @apiResource with key-value field, like:
meta="title":"Event created"|"message":"Event successful created"

Or add this feature as additional tag like:
@apiResourceAdditional title="Event Created" message="Event successful created" "my custom key"="my custom value"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant