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

Hide "path" attribute when returning Attachment models #184

Open
mitchkramez opened this issue Aug 9, 2017 · 0 comments
Open

Hide "path" attribute when returning Attachment models #184

mitchkramez opened this issue Aug 9, 2017 · 0 comments

Comments

@mitchkramez
Copy link

Our API returns some images that have been uploaded, but for the public API, we'd like to hide the path attribute from the content and only include the url. Obviously we can filter this out manually, but was hoping there was a way to not return this. We've tried setting a $hidden on the model to no avail:

"image": {
    "medium": {
        "path": "/vhosts/domain.dev/httpdocs/public/images/medium/missing.png",
        "url": "/images/medium/missing.png"
    },
    "thumb": {
        "path": "/vhosts/domain.dev/httpdocs/public/images/thumb/missing.png",
        "url": "/images/thumb/missing.png"
    },
    "original": {
        "path": "/vhosts/domain.dev/httpdocs/public/images/original/missing.png",
        "url": "/images/original/missing.png"
    }
}

Is there a simpler way to hide this attribute?

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

No branches or pull requests

1 participant