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

SEO Friendly Image Names - UploadsController.php #1439

Closed
wants to merge 2 commits into from

Conversation

Pushkraj19
Copy link

Added SEO friendly file names for images.

Added SEO friendly file names for images.
@Pushkraj19 Pushkraj19 changed the title Update UploadsController.php SEO Friendly Image Names - UploadsController.php Nov 9, 2024
store() Method:

Extracts the file’s original name and generates a unique identifier using a shortened md5 hash based on the filename.
Constructs a unique filename in the format of original-name-uniquehash.extension.
Stores the file with the generated filename and returns the file URL.

destroy() Method:

Accepts a filename as a payload in the request body.
Builds the storage path for the specified filename and attempts to delete it.
Returns a 204 No Content response on successful deletion or a 400 response if no filename is provided.
@Pushkraj19 Pushkraj19 closed this Nov 9, 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.

1 participant