Laravel Upload Image and Create Storage Link

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
alright guys in previous video we did our our system flash messes okay now in this video we're going to upload an image so we want to have one input type here for email and we're gonna upload image for our product so before doing that in our in our database there is no where is that there is you can see there is no field for you know email so let's let's update our migration model so that we can have that in here so we have to remove every data okay so let's let's do that let's let's go to our migration now inside that inside I wish let's go inside migration there is rip rock and we'll say dollar table we're making a column and it'll take a string and we'll say emails all right it will add image column and with type string what's wrong here no all right let's save it our migration is done now let's open our model where is that yeah here and we'll just add here image - fillable means all right let's save that now let's let's migrate that so for that we have to do PHP artisan migrate race you have you can do that this in developing more but in your you know production more you it'll move all the data let's enter and you can see it'll who are all the data all products all category everything okay we'll give just everything empty its migrating now let's refresh yeah you can see everything is gone everything alright now we can create that of course from our front-end let's create a few of them because we want a source okay that thinks let's create category kitchen appliances again all right let's some eat that and let's let's create our props at Barratt there is only one okay I will say title let's say what little tap tap let's do price and some eat that image doesn't have a default value Oh so it means now let's let's have you know we can actually do that in in our migration we can say na level we can say na level but we want to say that because we want our image stupid here we can say that okay and it will not ask so now let's let's let's add here you know our let's add form for uploading file let's search bootstrap for our emails uploading form okay and in documentation let's see image thumbnails input will keep item now let's search this let's see what we get we need file ok for that let's add let's let's open our form let's close this this is in create blade alright and where it is yeah from we have to say Inc Tom multi-part what was that I forgot anyway we'll have that his file the farms where are you where are you yeah Harry did tooth file it sit like this okay so let's let's copy this you know are this farm group and let's paste it somewhere yeah after selecting K let's say this let's select select product image will say alright and yeah type file let's give name image images to image and yeah everything must be good now also no cancel that's your face yeah here we have and let's skip margin top of to you and the why is working yeah and where is that let's show three ink type and then we need data getting type multi-part funded okay let's copy this and let's put in our farm where it is come on come on yeah let's paste that here and let's save this all right now we we have it means okay on our farm name email let's save that from here this is amazing we don't want a string so we will save string in database and you know our our our image will be in our storage folder right here you can see where it's storage here in the stories you'll see soon inside happens at public there will be our folder so let's that's right good to save our image all right after requesting will we have to save our image if we'll say if if dollar request if the request has as file as file image and after that we'll say dollar destination underscore pad this will this will say where we want to save our image we'll say inside public key inside our stories it will be actually in two parts to folder we have to create storage link will do that and image so what is our image images our request or request request file image all right final image is our image parties where we want to set that and our image name what is our amazing name this is one wonder what we want our image to have name okay ms-dos a get client or is no name so it's a original name let's do that and Pat will say Patty's goes to $1 request another request file image store and is it'll store in our destination pot and it will save our image means name okay all right and after doing that it'll store and we want to see that our input image which is you know inside input so we'll say input as one image which will be our main underscore name alright let's let's save that and let's try to do what will happen and we have to also create PHP artisan stories link so it'll save our you know it say that or it says from Bob block public storage link has been connected to log stories and public okay look you saying is what it's saying is image will be saved here okay public air will be want stories link ok stories link so so image from here can be here okay can you see that Charlie let's your face let's add TV let's download TV mais download TV debates missus we'll go to an space actually which TV is not let's do this save image ads we want to have a decent desktop all right what happened let's say it TV TV gpec alright no work on that yeah so let's say that all say we have to sit television because of validation caps lock is on alright let's have it nothing matters take stop TV jpz so I made that and it's a television actually say let's see our products if there is you can see TV jay-bez is in here so our name is Xavier and let's see our stories folder if there is or not actually I have to start my this once again because you know it is not working I have to really search for solution ok ok let's see if there is we can also in public yeah hairy stories you know God stories link created see here is image all right and now let's see in our stories folder to any stories there is a public yeah yeah you can see that so now we have simply male and it is also in our stories and also in public so in the next video so that or in this video maybe let's try to have now in welcome blade where we'll say all right after category let's say image all right and category after category so copy this paste and inside here we'll say that mmm it should be image tag actually he made SRC is equals to here we'll have our bad guy and let's close this alright and inside you will say our Pat so it will be asset and inside here I don't know am i right and wrong let's see where is our that story's public so let's do slash public / what is folder you missus / images / products product PR products products and will conk at it with dollar product II means all right let's let's try to see it I have to start feed speedy audition sir all right let's refresh that it's broken so let's let's see let's inspect it okay so we can you know have our bat no clothes has public image let's open that in panel new panel and here we'll see / stories st o RG e isn't found slashing this last bag let's do that [Music] Google host let's open this in you know he misses public for us I don't think we have to say these Nexus Joyce Stewart's last images I know how it works yeah you can see that so let's send that to stories yeah and let's refresh here you can see it is a little bit much longer let's say alright so let's have some height here we'll say height is equals to 100 px and yeah it's good let's have 54 now we just want to so alright let's download this in my yeah and I'll say watch and yeah let's let's save that that product watch price actually I have to add more you know category its but that's okay yeah you can see that so that's how we can do we can also you know like Aaron's this slightly comments time to like you can click and open but this is you this is basics okay as I just don't want to do that I may have another series but that but for now our image saved and let me show you what is done is how these stories folder is created from where it saying public minutes products will create file inside public inside images inside product it'll create a file alright so that's it for this video this is quite a bit longer I could have ended like in five seven minutes but you have to understand it okay so the next video and what I'm going to do what will she dad okay thank you for watching guys
Info
Channel: Code Online
Views: 24,168
Rating: undefined out of 5
Keywords: laravel, image upload, multiple image, storage link, symlink, file upload
Id: F2bOKt_E4QQ
Channel Id: undefined
Length: 17min 27sec (1047 seconds)
Published: Sat May 09 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.