In this video, we are going to create a controller for allowing a user to update the cover image.
All right.
For this one, we can post this video and give it a shot because the concept is going to be the same
way as we did for profile image upload.
All right.
So let's see how inside the controller is for users.
We are going to copy the entire logic.
So I will select the try and then I will copy this one.
And for upload cover image, I'm going to replace with this one.
The same concept, the difference here is going to be the field is going to be as cover image.
So let me locate the user and let me have a look at the property, which is cover image.
So in here I remove this one and make use of cover image and that is it.
The last step is that we need to protect the root.
So let's get back to the root and then the users and the users root here.
And this is a controller for updating the cover image.
So I'm going to remove the ID from here and I'm going to pass the same protected and then the motor
configuration as that.
So now everything is going to work fine.
So let's go ahead and then update the cover image.
So inside the tender client, which is this one, let's remove the ID and let me go to body form and
then reduce the screen size and select files and make use of profile.
And then the image I want to upload for the cover image.
So let me use a different image, which is this.
And you can see we have the files being updated, we have the cover image and then the profile image.
Everything works fine.
So if we check our cloud dashboard, when I refresh it, we are going to have a folder called BLOCK
App version three.
So click on Media Library.
And for me, I'm going to have a couple of folders because I have an application that I have built.
So this what we have called BLOCK App version three, If I open that, let's have a look.
And these are the images that I have uploaded so far.