each user has an id, just create a folder with that name, in say storage/app/public/userimages/
You can create the folder if it does not exist the first time the user uploads an image
Hi guys, new here. So, I am new to PHP, and even though I know a few things, I've been following some tutorials and things like that to help increase my knowledge. One of the things I recently did, was follow this tutorial: I have everything working, and I like how it works. What I want, is for the users who are logged in (eventually from their own profile page/etc) to be able to upload images to a folder that is generated automatically by their username (not one that I myself, the developer, made). Say I am a standard user on the site. My username is JohnDoe01, which is stored and saved with the method in the link I provided above (I believe in the $username variable). Let's say there is already a user profile function on the website. I go to my profile, and I want to upload images to my profile, and the profile page will call for those images to display on the just MY profile page. How it should work, is EITHER when the user registers, it makes a profile folder for that user's profile, (say: ".../.../users/$username/images" ) is placed in-- OR, it generated a new folder specifically for images, (say: ".../.../users/images/$username" ). I can then just create some code that calls on the images folder for $username and displays them on the user's profile page (which I already have a script for).
My question is, how can I use the login/registration system that was described in the link above, and do something like this? I've looked at a few tutorials/guides/etc, but they are all broken because their variable assignment is way different, or their login system is different, etc.
I hope I explained this all good enough.
P.S. I realized after I wrote this I couldn't insert links "on my first day"... so maybe we can still find a solution regardless. Thanks
Please or to participate in this conversation.