1
00:00:00,840 --> 00:00:08,400
In this video, we are going to create a controller for allowing a user to update the cover image.

2
00:00:08,430 --> 00:00:08,940
All right.

3
00:00:08,940 --> 00:00:15,240
For this one, we can post this video and give it a shot because the concept is going to be the same

4
00:00:15,240 --> 00:00:18,660
way as we did for profile image upload.

5
00:00:18,780 --> 00:00:19,230
All right.

6
00:00:19,230 --> 00:00:23,360
So let's see how inside the controller is for users.

7
00:00:23,370 --> 00:00:26,670
We are going to copy the entire logic.

8
00:00:26,670 --> 00:00:31,380
So I will select the try and then I will copy this one.

9
00:00:31,380 --> 00:00:36,430
And for upload cover image, I'm going to replace with this one.

10
00:00:36,450 --> 00:00:43,140
The same concept, the difference here is going to be the field is going to be as cover image.

11
00:00:43,140 --> 00:00:50,610
So let me locate the user and let me have a look at the property, which is cover image.

12
00:00:50,610 --> 00:00:56,700
So in here I remove this one and make use of cover image and that is it.

13
00:00:56,730 --> 00:01:00,210
The last step is that we need to protect the root.

14
00:01:00,210 --> 00:01:05,489
So let's get back to the root and then the users and the users root here.

15
00:01:05,700 --> 00:01:11,250
And this is a controller for updating the cover image.

16
00:01:11,250 --> 00:01:19,560
So I'm going to remove the ID from here and I'm going to pass the same protected and then the motor

17
00:01:19,560 --> 00:01:21,930
configuration as that.

18
00:01:22,470 --> 00:01:25,290
So now everything is going to work fine.

19
00:01:25,320 --> 00:01:29,390
So let's go ahead and then update the cover image.

20
00:01:29,400 --> 00:01:41,040
So inside the tender client, which is this one, let's remove the ID and let me go to body form and

21
00:01:41,100 --> 00:01:47,310
then reduce the screen size and select files and make use of profile.

22
00:01:49,110 --> 00:01:53,430
And then the image I want to upload for the cover image.

23
00:01:53,460 --> 00:01:57,660
So let me use a different image, which is this.

24
00:02:00,780 --> 00:02:09,440
And you can see we have the files being updated, we have the cover image and then the profile image.

25
00:02:09,449 --> 00:02:11,550
Everything works fine.

26
00:02:11,550 --> 00:02:21,150
So if we check our cloud dashboard, when I refresh it, we are going to have a folder called BLOCK

27
00:02:21,180 --> 00:02:22,770
App version three.

28
00:02:23,010 --> 00:02:25,980
So click on Media Library.

29
00:02:26,490 --> 00:02:33,060
And for me, I'm going to have a couple of folders because I have an application that I have built.

30
00:02:33,150 --> 00:02:40,710
So this what we have called BLOCK App version three, If I open that, let's have a look.

31
00:02:41,430 --> 00:02:45,570
And these are the images that I have uploaded so far.

