Update Profile Picture Instantly After Uploading in Laravel and Vuejs

  Рет қаралды 12,043

Code Inspire

Code Inspire

Күн бұрын

Пікірлер: 61
@butcherfirewaters
@butcherfirewaters 3 жыл бұрын
8:52 - how to bind this field, where was the name - girl-2.png , after uploading? Because when we are using CRUD with File upload - and after updateMethod, always leave the name of last File ?!
@technicalcreations8489
@technicalcreations8489 5 жыл бұрын
a quick fix which encounters in the console but it has no effect in front end getProfilePhoto(){ //default avatar pic if there is no photo of user let photo = "img/user.png"; //returns the current path of the if (this.form.photo) { if (this.form.photo.indexOf('base64') != -1) { photo = this.form.photo; } else { photo = 'storage/profiles/' + this.form.photo; } return photo; } return photo; }
@pathros425
@pathros425 5 жыл бұрын
Nice! Based on your code, mine is as follows: ------------------------------------------ getProfilePhoto(){ //default avatar pic if there is no photo of user if(this.form.photo){ return (this.form.photo.length > 200) ? this.form.photo : "storage/profiles/"+this.form.photo; }else{ if(this.form.sex === 'female'){ return "/img/defaultfemaleuser.png"; }else{ return "/img/defaultmaleuser.png"; } } },
@technicalcreations8489
@technicalcreations8489 5 жыл бұрын
i have little changes in code getProfilePhoto(){ //default avatar pic if there is no photo of user let photo = "img/user.png"; //returns the current path of the if (this.form.photo) { photo = (this.form.photo.indexOf('base64') != -1 ? this.form.photo : 'storage/profiles/'+ this.form.photo); return photo; } return photo;
@harri4007
@harri4007 5 жыл бұрын
nice one....thanks for that!
@webdev2659
@webdev2659 4 жыл бұрын
@@technicalcreations8489 Thank you so much man you made my day! . You diverse thousands of likes
@technicalcreations8489
@technicalcreations8489 4 жыл бұрын
@@webdev2659 your welcome
@pedro-j
@pedro-j 5 жыл бұрын
You said at the beginning of the video that we don't have to worry about the "127.0.0.1:8000/img/profile/ 404 (Not Found)" ... But what is the cause of that? How to solve it? You references about a video where you solve it, ... which video ??
@ziikyii2463
@ziikyii2463 6 жыл бұрын
best tutorial videos and series ever... love everything about your work - github project for public
@CodeInspire
@CodeInspire 6 жыл бұрын
Yes, sure, that's next. I am recording the videos
@elmantaghiyev8875
@elmantaghiyev8875 5 жыл бұрын
Dear All I have a problem. Problem is "localhost:8000/img/profile/ 404 (Not Found)". Can not find a profile page in my browser when I refresh my profile page. How to fix this problem?? Please help me.
@pianoboy1018
@pianoboy1018 6 жыл бұрын
Thank you sooooo much,these videos are very useful for me !!! About last issue, if "password" column is empty, there is different result of press the "update" button. I discover a part of your previous video was different , your updateInfo() function plus these code: if(this.form.password == ''){ this.form.password = undefined; } when I add these part into my updateInfo(),it's work!
@CodeInspire
@CodeInspire 6 жыл бұрын
Hi. yes, that works. Because that was my original project. Because it wasn't working for me, I added that. You can use it :)
@pianoboy1018
@pianoboy1018 6 жыл бұрын
@@CodeInspire I see. Thank you very much!
@pathros425
@pathros425 5 жыл бұрын
One thing that comes to my mind is to create a loop to walk every input and check if each one is empty, if so, set it to 'undefined' ... something like that...
@butcherfirewaters
@butcherfirewaters 3 жыл бұрын
@@CodeInspire Do you solve problem with errors in 36 video ?
@elinardosilva3812
@elinardosilva3812 6 жыл бұрын
i man! please helpe. When i do login with user without picture i get this error "Error in render: "TypeError: Cannot read property 'length' of null" what's it?
@CodeInspire
@CodeInspire 6 жыл бұрын
oh yeah, You can use default image if user doesn't upload one. Write a condition to check if user has picture or not.
@elinardosilva3812
@elinardosilva3812 6 жыл бұрын
@@CodeInspire i try this. Now i go to default img in backend
@PrabinPaudelComard
@PrabinPaudelComard 6 жыл бұрын
can you make a tutorial on multiple insert of images with vue and laravel with API.
@elinardosilva3812
@elinardosilva3812 6 жыл бұрын
I friend. I'm fallower your videos, but using vue outsider of API laravel. I have a error when save profile without photo. Everytime is dublicate way of this imagem... Whats can i do? Pleaee helpee. Thanks
@CodeInspire
@CodeInspire 6 жыл бұрын
Hi man. You have to give the uploaded image a unique name when uploading. that way, it will not duplicate. it will create another image.
@elinardosilva3812
@elinardosilva3812 6 жыл бұрын
@@CodeInspire but where i define this? In my controller i'm using tour code to define name of image. Bit if i edit without a imagem iis generete a dublicate...
@elinardosilva3812
@elinardosilva3812 6 жыл бұрын
Hi my error is in $imageName = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1]; It's necessary when use base64? I'm set name another way and resolve. Thanks
@zkop1
@zkop1 5 жыл бұрын
Hi. can u show how to test api in Postman?
@butcherfirewaters
@butcherfirewaters 3 жыл бұрын
Do you find the solution ? How to test in postman with Autorization?
@ihabhamad8290
@ihabhamad8290 6 жыл бұрын
thank you so much, but you can please show us how can using veux stores and mapGetters and mapSeters and also more complex code
@CodeInspire
@CodeInspire 6 жыл бұрын
YOu're very welcome :) Probably not now. Maybe in future videos if we need
@devsdavid633
@devsdavid633 6 жыл бұрын
Hi its easy to follow your tutorial, please make a video on building ecommerce web application with laravel and vue js or any application with laravel and vue
@CodeInspire
@CodeInspire 6 жыл бұрын
Coming soon :)
@devsdavid633
@devsdavid633 6 жыл бұрын
@@CodeInspire Thanks, please use Laravel as for backed
@MohammedHassarov
@MohammedHassarov 6 жыл бұрын
Hello brother, i think the best solution is to use event Fire.$emit('reloadProfileEvent'); and create a function loadProfile with a $on event like this we keep the code clean and easy to read :)
@CodeInspire
@CodeInspire 6 жыл бұрын
because, you can inform other components that something happened. with calling function, you have to do it everywhere. It's good when you use it between two components.
@elpda-solutions
@elpda-solutions 6 жыл бұрын
Thank you so much again for this tutorial, Is there way to store data into two tables with 1 to 1 relationship, Let's say User and Profile
@CodeInspire
@CodeInspire 6 жыл бұрын
Very welcome. Yes it's. But, since every user need profile, we don't need to create another table for that. Do we ??
@elpda-solutions
@elpda-solutions 6 жыл бұрын
Thank you, I managed to do it, The reason is I was avoiding having to put so many fields in one table.. One question I want to ask, is how to return data from both tables, i know how to do it in laravel blade but not sure with vuejs
@CodeInspire
@CodeInspire 6 жыл бұрын
It's the same in vuejs. Except, use dot " . " instead of "->" For example blade $user->posts Vuejs user.posts
@elpda-solutions
@elpda-solutions 6 жыл бұрын
@@CodeInspire thanks!!
@chrissfirstmoters
@chrissfirstmoters 6 жыл бұрын
Thank you so much, and i hope you doing well
@tapaninboundwebhub9408
@tapaninboundwebhub9408 6 жыл бұрын
Could you please explain how to change profile photo and all the information after form update? Keep inspiring!
@CodeInspire
@CodeInspire 6 жыл бұрын
hmm yeah. but it's nice if you give it a try :)
@tapaninboundwebhub9408
@tapaninboundwebhub9408 6 жыл бұрын
yes. works fine, Thanks ;)
@loremipsum574
@loremipsum574 6 жыл бұрын
Include also changing the profile photo in the navigation bar.
@nsoimaru
@nsoimaru 5 жыл бұрын
{{ Auth::user()->name }}
@randyharsh3046
@randyharsh3046 6 жыл бұрын
but using $emit (last method) is not very productive, isnt it?
@CodeInspire
@CodeInspire 6 жыл бұрын
yeah true, but very usefull
@adam192021
@adam192021 6 жыл бұрын
The BEST as always!
@CodeInspire
@CodeInspire 6 жыл бұрын
thanks buddy :)
@getwister
@getwister 6 жыл бұрын
Nice course! Could you teach how to customize the application? pls! Greetings from Brazil! 👍
@CodeInspire
@CodeInspire 6 жыл бұрын
Oh sure, I will :)
@getwister
@getwister 6 жыл бұрын
@@CodeInspire Thank you very much! Keep up the good work!
@dwiyudirayia3183
@dwiyudirayia3183 6 жыл бұрын
Thanks !!
@prantabhuiyan9676
@prantabhuiyan9676 6 жыл бұрын
after the update we can also reload the data, it will also solve the problem :) calling $emit function
@CodeInspire
@CodeInspire 6 жыл бұрын
Yes, we do that also
@ruipeng1624
@ruipeng1624 6 жыл бұрын
great tutor
@engelbertvillar8747
@engelbertvillar8747 5 жыл бұрын
:src="this.form.photo" is working fine with me for real time profile update no need to use ternary :), ithink
@rajasekhary7353
@rajasekhary7353 6 жыл бұрын
Bro waiting for next video
@CodeInspire
@CodeInspire 6 жыл бұрын
Just uploaded :)
@LucasCarvalhoO
@LucasCarvalhoO 5 жыл бұрын
getProfilePhoto(){ if(this.form.photo != ""){ let photo = (this.form.photo.length > 200) ? this.form.photo : "/images/profile/"+ this.form.photo ; return photo; } return ""; }, This is better cause miss the error
@ahmadawan3653
@ahmadawan3653 5 жыл бұрын
Password Problem for some people is occur because you write the code but sir you forget to tell about that one thats why this problem face alot .... if password == "" than assign the undefine value the password i hope it will OK now THanks
Easily Add ACL to Laravel Without Extra Tables in Database
7:54
Code Inspire
Рет қаралды 11 М.
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
Samsung S25 Ultra Hands On - The New Era
17:06
Mrwhosetheboss
Рет қаралды 630 М.
Limited Access to Controllers Using ACL in Laravel
7:46
Code Inspire
Рет қаралды 10 М.
Image Upload & Update Profile | Laravel 10 Tutorial #27
24:50
Yelo Code
Рет қаралды 16 М.
Vue Image Upload Made Easy
9:51
Academind
Рет қаралды 232 М.