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

[v6] upload_multiple hidden input is clear_photos, should probably be _clear_photos #5085

Open
tabacitu opened this issue May 30, 2023 · 0 comments

Comments

@tabacitu
Copy link
Member

I was working on the v6 docs and noticed this in the upload_multiple field docs:

NOTE: This field uses a clear_{fieldName} input to send the deleted files from the frontend to the backend. In case you are using $guarded add it there.
Eg: protected $guarded = ['id', 'clear_photos'];

I wasn't aware this needs to be done, and it's odd to me. Because that field will NEVER get saved to the database, so why unguard it? It's probably because if we don't... it will get stripped, right? So then what if we add an underscore before it? AFAIK:

  • that's the convention Laravel uses for "helper" parameters (eg. _csrf)
  • in the stripping function I think we already don't strip underscore parameters
@tabacitu tabacitu changed the title [Small fix] upload_multiple hidden input is clear_photos, should be _clear_photos upload_multiple hidden input is clear_photos, should probably be _clear_photos May 30, 2023
@tabacitu tabacitu changed the title upload_multiple hidden input is clear_photos, should probably be _clear_photos [v6] upload_multiple hidden input is clear_photos, should probably be _clear_photos Jun 20, 2023
@tabacitu tabacitu moved this to Todo in This week Jun 20, 2023
@tabacitu tabacitu removed this from This week Jul 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants