Laravel User Image

  Рет қаралды 135,968

devdojo

devdojo

8 жыл бұрын

devdojo.com/ninja - Learn how to create your own Software as a Service in my Ninja Training Program.
devdojo.com/episode/laravel-u... In this video we'll teach you how to add a user profile image in your Laravel App.
Checkout the following repo for the source code: github.com/thedevdojo/laravel...

Пікірлер: 189
@slaction
@slaction 8 жыл бұрын
Great video. It's refreshing to hear someone speaking clear english on Laravel tutorials!
@hugojose12
@hugojose12 4 жыл бұрын
relatable wtf
@shaneholmes6218
@shaneholmes6218 4 жыл бұрын
Ditto!
@albi3235
@albi3235 2 жыл бұрын
so true. Im not a native englsih speaker and its sometime hard to understand
@befuture_ru
@befuture_ru 8 жыл бұрын
Интересный и полезный курс, спасибо большое автору !!!
@SidDefinition
@SidDefinition 8 жыл бұрын
All hail devdojo, this is exactly what I was looking for!
@freemqwer
@freemqwer 8 жыл бұрын
Great channel for novice. Thanks Tony!
@fajoe5757
@fajoe5757 7 жыл бұрын
Great! It's working perfectly. I added it to my Laravel best youtube videos playlist ;)
@MasterJ0n
@MasterJ0n 8 жыл бұрын
Thanks very much, love the video Tony. Hope to have more. Keep it coming!
@Brocollipy
@Brocollipy 7 жыл бұрын
Excellent tutorial. Thanks so much for doing this.
@ismaila2790
@ismaila2790 5 жыл бұрын
Worked like a charm ! Thank You.
@yiyuxu9416
@yiyuxu9416 7 жыл бұрын
nice tutorial, learned a lot, clear and easy to learn
@tulsirammarasini3352
@tulsirammarasini3352 4 жыл бұрын
Great video , also working in laravel 6 , keep giving like this tutorial
@collinsodeny
@collinsodeny 6 жыл бұрын
You make it look so simple thanks :)
@rodrigopastl
@rodrigopastl 2 жыл бұрын
Thank you so much. You have helped me a lot with this video.
@shaneholmes6218
@shaneholmes6218 4 жыл бұрын
Awesome! Thank you for sharing!
@MsPoitras
@MsPoitras 7 жыл бұрын
Thanks alot, still working with 5.4!
@manojpriyamantha
@manojpriyamantha 4 жыл бұрын
it is working. thank you dojo 👈
@bilalfarhat5169
@bilalfarhat5169 7 жыл бұрын
Amazing Tutorial :) Thank you very much
@sopheakchan4518
@sopheakchan4518 5 жыл бұрын
Awesome ! It work, thank you so much guy.
@ismailcemaltekin5435
@ismailcemaltekin5435 3 жыл бұрын
Allah razı olsun çok işime yaradı.
@Askbowe
@Askbowe 8 жыл бұрын
Here is a little addition to make it even better .. Just before Image::make($avatar) add the following: // Delete current image before uploading new image if ($user->avatar !== 'avatar.png') { $file = public_path('uploads/avatars/' . $user->avatar); if (File::exists($file)) { unlink($file); } } So every time the user uploads a new photo the old one will be deleted for your server
@Sam-ih7xv
@Sam-ih7xv 8 жыл бұрын
could you show your all your code for this function as it doesn't work for me just keeps deleting the current image , i might have the order in the wrong way as within the if statement , thx
@Askbowe
@Askbowe 8 жыл бұрын
public function updateUserAvatar(Request $request) { $user = User::find(Auth::user()->id); // Handle the user upload of avatar if ($request->hasFile('avatar')) { $avatar = $request->file('avatar'); $filename = time() . '.' . $avatar->getClientOriginalExtension(); // Delete current image before uploading new image if ($user->avatar !== 'default.png') { // $file = public_path('uploads/avatars/' . $user->avatar); $file = 'uploads/avatars/' . $user->avatar; //$destinationPath = 'uploads/' . $id . '/'; if (File::exists($file)) { unlink($file); } } // Image::make($avatar)->resize(300, 300)->save(public_path('uploads/avatars/' . $filename)); Image::make($avatar)->resize(300, 300)->save('uploads/avatars/' . $filename); $user = Auth::user(); $user->avatar = $filename; $user->save(); } return view('subscription.profile', compact('user')); }
@Askbowe
@Askbowe 8 жыл бұрын
sorry I just gave you the entire thing ... At least you are able to see where i insert the piece of code (y)
@Sam-ih7xv
@Sam-ih7xv 8 жыл бұрын
haha na that's fine you fixed my problem which I really appreciate , I only check for user auth in the return method thats' why i was getting an error with the unlink method as i didn't know which user Id to unlink the image , thx
@royansyt804
@royansyt804 7 жыл бұрын
How to use or get User::find ? I have an error that the User controller is not define. Thanks in advance.
@Rahidt100
@Rahidt100 5 жыл бұрын
Solved the problem ! Thanks!
@jorgeperalta9780
@jorgeperalta9780 3 жыл бұрын
this was so useful, thanks
@arbnorsalihu3161
@arbnorsalihu3161 7 жыл бұрын
Very helpful. Many thanks.
@tahiriqbal8543
@tahiriqbal8543 5 жыл бұрын
impressed the way you explained (y)
@loremipsum574
@loremipsum574 6 жыл бұрын
Im testing at larevel 5.5 . It works. Thanks & subscribing. A big help for me. The only problem is if you keep pressing the button for a SUBMIT. no image appears.
@mindaugaspetraitis4055
@mindaugaspetraitis4055 6 жыл бұрын
I have the same problam Sir, have u solved it ?
@CesarEnriqueRomeroGarcia
@CesarEnriqueRomeroGarcia 6 жыл бұрын
your contain enctype="multipart/form-data"?
@faizanalishah7769
@faizanalishah7769 6 жыл бұрын
This is very informative and helpful tutorial thanks alot
@NathanGeerinck
@NathanGeerinck 8 жыл бұрын
Thang you for the great tutorial! :)
@angelitohizon1459
@angelitohizon1459 7 жыл бұрын
This is great! I want to learn more :)
@Ajuchacko91
@Ajuchacko91 8 жыл бұрын
I really wanna thank you for these wonderful tutorials you make. Truly Inspiring. THANK YOU :)
@tetike4753
@tetike4753 8 жыл бұрын
Bro, please help me it still shows the image of 09:03. How did you fix it ?
@Devdojo
@Devdojo 8 жыл бұрын
+Tetike Try not spamming all the users :) Thanks.
@tetike4753
@tetike4753 8 жыл бұрын
+devdojo Sorry :( I just wanted to fix it forgive mr
@davismaghanga1935
@davismaghanga1935 6 жыл бұрын
thanks so much for the video helped alot!!
@blackoutgo2597
@blackoutgo2597 8 жыл бұрын
thanks dude, your awesome!
@malumc4228
@malumc4228 5 жыл бұрын
great video !!! you are the best!
@MouayedElhak
@MouayedElhak 8 жыл бұрын
Nice and beautiful work
@ruicary9899
@ruicary9899 8 жыл бұрын
VERY GOOD,thanks your video
@info-ternak01
@info-ternak01 7 жыл бұрын
Great video, thanks.
@koraygurleyen5140
@koraygurleyen5140 6 жыл бұрын
Really amazing Thank you
@wassimbensassi7757
@wassimbensassi7757 6 жыл бұрын
this was helpful thanks ^^
@MozahidRanaRasel
@MozahidRanaRasel 7 жыл бұрын
Thank you :) this video is very uselful
@bilaltariq839
@bilaltariq839 8 жыл бұрын
Thank you for this
@igoralves1
@igoralves1 5 жыл бұрын
Great video !
@AmaroAmaral
@AmaroAmaral 5 жыл бұрын
Great! Thank You!
@Murang_pabahay
@Murang_pabahay 7 жыл бұрын
Thanks! It helps me a lot :) God bless!
@shohanhossain8280
@shohanhossain8280 7 жыл бұрын
You are a Star!
@sometimesplay1439
@sometimesplay1439 6 жыл бұрын
It's works for laravel v5.6!
@kopihitam12333
@kopihitam12333 6 ай бұрын
Thankyou broo!🙌
@subhadeepchowdhury9065
@subhadeepchowdhury9065 5 жыл бұрын
Great job
@ahmedmagdy6339
@ahmedmagdy6339 8 жыл бұрын
this really helped me thanks :) .. keep it up (Y)
@molkamoussi1382
@molkamoussi1382 3 жыл бұрын
thank you a lot is working 1000%%%%%%
@JeetDholakia
@JeetDholakia 8 жыл бұрын
Great tutorial. Can you make a video on how to crop the uploaded image using jcrop or any other? Because many a times the default aspect ratio is square and user uploads image of some other aspect ratio so by default it gets stretched or something. Thanks in advance.
@kelvingachiri942
@kelvingachiri942 7 жыл бұрын
Great video
@davidkahdze3474
@davidkahdze3474 8 жыл бұрын
you are the best
@5Gamingx
@5Gamingx 4 жыл бұрын
Thanks man
@CX6998
@CX6998 8 жыл бұрын
Would you be able to create videos on how to add tags from a database onto posts in the newsfeed (like the tags in StackOverflow)?
@icanhc
@icanhc 8 жыл бұрын
you are the best!
@tetike4753
@tetike4753 8 жыл бұрын
Bro, please help me it still shows the image of 09:03 How did you fix it
@Devdojo
@Devdojo 8 жыл бұрын
+Tetike Try not spamming all the users :) Thanks.
@rajaouachani8485
@rajaouachani8485 5 жыл бұрын
Thx soooo much
@ahmadlatif2047
@ahmadlatif2047 5 жыл бұрын
Very helpful video and just saying Allah bless you
@SXsoft99
@SXsoft99 8 жыл бұрын
is that "handsome looking guy" you? :) nice tutorial
@elyselys9367
@elyselys9367 6 жыл бұрын
Thanks bro
@sabmus
@sabmus 8 жыл бұрын
Hello, ty for the vid, really help me!. i have a question, how can i store the imagen in storage folder, and show it from there? ty in advance
@NatanMelonatan
@NatanMelonatan 7 жыл бұрын
Muito bom.
@jcesarqg6358
@jcesarqg6358 8 жыл бұрын
wow ,thanks, suscribe
@icacahyani9234
@icacahyani9234 7 жыл бұрын
thx!
@nestromae
@nestromae 5 жыл бұрын
thx for video, very appreciated! btw, probably would be nice to delete avatar from storage when replacing it with new one. if($user->avatar !== 'avatar.png') { // if not default avatar \Storage::disk('avatars')->delete($user->avatar); } To create disk you can put it into /config/filesystems.php 'avatars' => [ 'driver' => 'local', 'root' => public_path() . '/images/avatars', // you can have other path 'visibility' => 'public', ],
@bogdanz
@bogdanz 7 жыл бұрын
I'm using Voyager, so `intervention/image` was already installed. Also it stores the photos in `storage\users` folder. Need videos about integration Voyager avatar function and front-end
@fusion5329
@fusion5329 8 жыл бұрын
Hey do you have any tutorials on how to make so the main page changes when you log in, for an example i don't want their to be a log in button when i have already logged in. If so i would be greatful!
@Mohamud258
@Mohamud258 8 жыл бұрын
Thank you so much for this great tutorial. I have small issue, I am working localhost and image path is not correctly written in the mysql db. Sample of the image path in the db "C:\xampp\tmp\phpA49.tmp" can you please help
@jaymztrack
@jaymztrack 6 жыл бұрын
soy el único que sabe español acá? jajajaja si lees esto eres el puto amo! gracias...
@amitsonar3511
@amitsonar3511 7 жыл бұрын
hello sir i need your help . i want to know how to build the same thing as u have shown but without using any package
@ahmedragab4063
@ahmedragab4063 3 жыл бұрын
Thnx
@samdeacon7910
@samdeacon7910 6 жыл бұрын
hey have you guys done any videos on vue js?
@rayhan5768
@rayhan5768 6 жыл бұрын
Nice 👌👌👌👌
@carstenjobmann6249
@carstenjobmann6249 7 жыл бұрын
Addition: You can use exif_read_data() results to rotate the image (for example if you get images from a mobile phone). Example: $exif = @exif_read_data($file); if (isset($exif['Orientation']) && $exif['Orientation'] == '8') { Image::make($pathTMP)->rotate(90)->save($pathOrg); }
@Volnianskii
@Volnianskii 3 жыл бұрын
HI! Thank You! What about adding filetype validation here?
@aslanaitkulov506
@aslanaitkulov506 5 жыл бұрын
thks
@EvertRamos
@EvertRamos 8 жыл бұрын
Hello Tony, Nice video! Woud you know how does Laravel Spark get the cache picture of my gmail? I did not even upload any photo and it brough the image... any tips on that? Thanks!
@lespaulmendiolaii390
@lespaulmendiolaii390 5 жыл бұрын
How can I possible adapt it to my Laravel CRUD without the Users Auth?
@nipunasudha
@nipunasudha 8 жыл бұрын
awesome bro
@tetike4753
@tetike4753 8 жыл бұрын
Bro, please help me. It still shows me the picture of 09:03 Please tell me how did you fix it
@Devdojo
@Devdojo 8 жыл бұрын
+Tetike Try not spamming all the users :) Thanks.
@rohmatmret8265
@rohmatmret8265 8 жыл бұрын
Good night Sir Sory Im From indonesia I hope you can help me how to display a flash notification message to a specific time in laravel 5.2
@elmomahupil
@elmomahupil 3 жыл бұрын
THANKYOUUUUUUUUUUUU :'>
@judgementday2022
@judgementday2022 7 жыл бұрын
I have a question. I created a product view with model and controller. then I created a blade template which holds a thumbnail and gets the data obj from product controller. Now when I include my product.blade.php in the welcome.blade.php it covers everyone on my welcome page. If I remove the data obj i can see it display the thumbnail using a simple for loop.
@fnusaba7128
@fnusaba7128 7 жыл бұрын
NotFoundHttpException in RouteCollection.php line 161: I am keep getting this error does anyone know why ?
@muhammadabduhsiregar9190
@muhammadabduhsiregar9190 7 жыл бұрын
hey bro, thanks for the tutorial, but i have a problem, my avatar didn't update, no error, can you help me?
@KaushikPoojari
@KaushikPoojari 7 жыл бұрын
Hey devdojo, Could you please tell me how can i link the above tutorial of User's Profile Image with your chatter package..? Thanks in advance :D
@puneethp537
@puneethp537 6 жыл бұрын
which version of laravel you are used????
@hometown-flavors
@hometown-flavors 6 жыл бұрын
(1/1) NotFoundHttpException in RouteCollection.php (line 179) this error occurs while make a profile page
@abdb7174
@abdb7174 7 жыл бұрын
please show us how to make a photo galleries, thanks
@nageshbk1
@nageshbk1 6 жыл бұрын
sir , when I try to submit profilr image I am getting this error- "Call to a member function getClientOriginalExtension() on boolean"
@epicestgamer9778
@epicestgamer9778 4 жыл бұрын
Helo sir
@dzyof
@dzyof 8 жыл бұрын
how to delete photos from the folder when the user changes its profile?
@leadit7848
@leadit7848 5 жыл бұрын
how will I be able to use this in ajax?
@mehmetmunaf3610
@mehmetmunaf3610 7 жыл бұрын
am using windows 10 and get this error Unable to read image from file (). any suggestions ?
@hometown-flavors
@hometown-flavors 5 жыл бұрын
which error occur when file size is too large
@erielchavez9752
@erielchavez9752 7 жыл бұрын
Are you saving the image in the database? or youRE saving it in another folder and just saving the file name of the image?
@xanthos733
@xanthos733 7 жыл бұрын
Filename is saved in the database the .jpg itself is saved in the folder '/uploads/avatars' so 'or youRE saving it in another folder and just saving the file name of the image?'
@letecianaquines5743
@letecianaquines5743 5 жыл бұрын
can you make a tutorial again with this topic?
@guilhermemoraes4055
@guilhermemoraes4055 3 жыл бұрын
How can I upload each user profile pictures in separate folder, because later it will be a mess...
@YasirMalik24
@YasirMalik24 6 жыл бұрын
after submit it shows (1/1) NotWritableException Can't write image data to path (D:\wamp\www\project\public\/uploads/page/small/1509780886.jpg)
@abdi_pie7266
@abdi_pie7266 4 жыл бұрын
excuse me sir, what is the syntax theme?
@rogermartinez9566
@rogermartinez9566 3 жыл бұрын
Hi im working in laravel 8 but i cant get the use Image to work, it says its not defined
@vardgeskeshishyan380
@vardgeskeshishyan380 7 жыл бұрын
Hi devdojo my submit do nothing, what can i do??
@zhichengyu950
@zhichengyu950 6 жыл бұрын
why the default.jpg images can not show ??
@tetike4753
@tetike4753 8 жыл бұрын
Thaaaaaaaaaaaaanks! I was gonna leave laravel cuz i couldnt add images :D I have another question. Can you make a video of how to create a news feed with Laravel?
@Devdojo
@Devdojo 8 жыл бұрын
+Tetike Did you end up getting the image to show? Sure I can create a video on news feed with Laravel. Make sure that you add the image located in public/uploads/avatars/ have you confirmed the image is there? Let me know. Thanks.
@tetike4753
@tetike4753 8 жыл бұрын
+devdojo Hello devdojo. I really loved and still loving your tutorials :D #ANSWER1 Yeah, please add a tutorial of how to create news feed in laravel. I am running a new social media site. Still growing with your videos. #ANSWER2 My image location /public/uploads/avatars/default.jpg ( i am using windows) Please help me fix it and thanks again.
@miodragniss
@miodragniss 8 жыл бұрын
+Tetike maybe remove the “default.jpg” part?
@tetike4753
@tetike4753 8 жыл бұрын
+miodragniss Dont understand. do you mean to call it default only ? I did that and It still doesn't work
@tetike4753
@tetike4753 8 жыл бұрын
+devdojo Can you answer my long reppy of #ANSWER1 AND 2?
@firojkhan-kv1ew
@firojkhan-kv1ew 6 жыл бұрын
Hello sir, I have performed all the steps which you telling us but at profile upload it not working it gives a error like Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException
ОБЯЗАТЕЛЬНО СОВЕРШАЙТЕ ДОБРО!❤❤❤
00:45
Chapitosiki
Рет қаралды 3,3 МЛН
A teacher captured the cutest moment at the nursery #shorts
00:33
Fabiosa Stories
Рет қаралды 52 МЛН
Каха заблудился в горах
00:57
К-Media
Рет қаралды 9 МЛН
You might not need useEffect() ...
21:45
Academind
Рет қаралды 155 М.
Laravel Admin Package - Voyager
7:58
devdojo
Рет қаралды 148 М.
Laravel Language Switcher
27:58
Andre Madarang
Рет қаралды 87 М.
The New dialog HTML Element Changes Modals Forever
12:09
Web Dev Simplified
Рет қаралды 582 М.
Image Uploads with Laravel
9:43
devdojo
Рет қаралды 54 М.
Wordpress vs coding - why devs SHOULD learn Wordpress
11:03
SuperSimpleDev
Рет қаралды 291 М.
Laravel Dusk: painless browser automation
20:49
Aaron Francis
Рет қаралды 14 М.
Laravel Forum Package - Chatter
8:33
devdojo
Рет қаралды 52 М.
ОБЯЗАТЕЛЬНО СОВЕРШАЙТЕ ДОБРО!❤❤❤
00:45
Chapitosiki
Рет қаралды 3,3 МЛН