Skip to content
Advertisement

upload image to server modifying name

I am building a form with laravel 5.6 and where I save a name and a user photo, but i need the photo to be stored with the username. I show the code of my store

JavaScript

I can get the username with $request->nombre;

but I don’t know how to assign that name to the photo

Advertisement

Answer

There is a ->storeAs() method available on the Laravel’s request object.

You can use it like:

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