Skip to content
Advertisement

How do I update the incoming value if it’s a photo? [LARAVEL 9]

i have a question.

database settings table : enter image description here

When adding a new setting I am sending data like this :

JavaScript

and I’m querying this while editing:

JavaScript

update method:

JavaScript

my question is: if value part is photo how can i update it as photo…

Advertisement

Answer

You can use the UploadedFile‘s store or storeAs to store the uploaded file and then store the file path as value in the database.

And don’t forget to have enctype="multipart/form-data" on the form

JavaScript

Laravel Docs – Request – Files

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement