1
00:00:00,300 --> 00:00:06,540
Beautiful, and once we have the modern in place now, let's set up the entire structure where I want

2
00:00:06,540 --> 00:00:14,760
you to create a view controller in the controllers and create following functions as far as functionality

3
00:00:15,000 --> 00:00:20,850
as I always were, just sending the function name just so understand what's happening in a postman that

4
00:00:20,850 --> 00:00:26,550
we want to set up review routes in the route, import all the controllers.

5
00:00:26,550 --> 00:00:34,500
And when it comes to access, get our views and get similar view will be accessible to the public.

6
00:00:34,770 --> 00:00:38,700
However, the rest of them are only accessible if.

7
00:00:39,910 --> 00:00:41,860
The user has logged in.

8
00:00:42,140 --> 00:00:48,460
So if there is a user and remember what middleware we have two years now, gotcha here is that we're

9
00:00:48,460 --> 00:00:52,300
not looking for the admin, I'm just looking for the user.

10
00:00:52,930 --> 00:00:57,070
So that's something you need to keep in mind as far as the up.

11
00:00:57,280 --> 00:00:58,180
Typical rest.

12
00:00:58,540 --> 00:00:59,560
We already covered that.

13
00:00:59,680 --> 00:01:01,000
So we have the Route one.

14
00:01:01,360 --> 00:01:06,100
And then if we have the I.D., then we go to Colin and Andy.

15
00:01:06,190 --> 00:01:13,030
We want to import that nab dress and we want to use the middleware to set it up.

16
00:01:13,360 --> 00:01:14,020
All right.

17
00:01:14,410 --> 00:01:19,750
Now let me start working on that where I want to go to controllers.

18
00:01:20,290 --> 00:01:22,390
You files, say a review.

19
00:01:23,390 --> 00:01:27,920
Controller controller and didn't hear.

20
00:01:28,840 --> 00:01:31,930
Five functional, I believe, I mean, the boat check.

21
00:01:32,200 --> 00:01:33,280
Let me just take this one.

22
00:01:33,310 --> 00:01:37,490
It's going to be probably easier if I can see everything that I need to work on.

23
00:01:37,520 --> 00:01:39,040
So those are my functions.

24
00:01:39,610 --> 00:01:47,350
Collins to create a view of you, a shank and Iraq and rose.

25
00:01:48,400 --> 00:01:50,770
Let's set up the functionality as that send.

26
00:01:52,130 --> 00:01:59,420
As that sand and we're looking for create review, let's say that one and now we want to copy and paste

27
00:02:00,290 --> 00:02:01,670
should be five, correct?

28
00:02:02,240 --> 00:02:06,560
So we go here, we get all your abuser.

29
00:02:07,780 --> 00:02:17,490
We're the same value here, so get all our viewers run and look for single ones or get single or you.

30
00:02:18,590 --> 00:02:20,480
And as far as the text.

31
00:02:21,730 --> 00:02:24,430
For years, get single review.

32
00:02:25,320 --> 00:02:29,190
And we have one for update and one for deleting, so.

33
00:02:30,270 --> 00:02:32,220
Let me update.

34
00:02:33,170 --> 00:02:34,220
As well as here.

35
00:02:35,250 --> 00:02:35,790
I'm David.

36
00:02:36,970 --> 00:02:45,340
And the same will be for the last one, so great review as though I was here, the late review, and

37
00:02:45,340 --> 00:02:49,730
then we want to export all the functions, so I guess I can just take these functions now.

38
00:02:49,930 --> 00:02:54,520
This is kind of handy where I can go module exports.

39
00:02:54,520 --> 00:02:58,090
I'm exporting an object, correct, and I just passed it in.

40
00:02:58,330 --> 00:03:04,690
Now I do want to remove the semicolon and Orion, and we want to go to the roots new file.

41
00:03:05,230 --> 00:03:07,000
I'll call this a review.

42
00:03:07,690 --> 00:03:09,070
ROUTS jobs.

43
00:03:09,700 --> 00:03:17,740
And as far as the set up, well, I think I'm going to use the user one again first six lines just because

44
00:03:17,740 --> 00:03:19,390
I don't want to repeat the boilerplate.

45
00:03:20,260 --> 00:03:23,430
So reviewers outs copy and paste.

46
00:03:23,440 --> 00:03:29,070
Now I can give you a hint we're not going to use permissions in this case, so we can just remove it.

47
00:03:29,260 --> 00:03:35,860
Just look for authenticate user when we want to grab also all the controllers.

48
00:03:36,900 --> 00:03:38,370
So let's take this object.

49
00:03:39,340 --> 00:03:45,160
Back in their view, roots, let's say, concert up in Paris and where is this coming from?

50
00:03:45,160 --> 00:03:54,520
Requir and we go to comptrollers and review controller and with everything in place now, we can set

51
00:03:54,520 --> 00:03:55,950
up right away our roots.

52
00:03:55,950 --> 00:03:57,850
So out that route.

53
00:03:58,150 --> 00:03:59,800
And I'm going to go with forward slash.

54
00:03:59,800 --> 00:04:06,430
And if you remember, our route route is going to be following API version one and then our reviews.

55
00:04:06,940 --> 00:04:08,770
And here I'll have to route.

56
00:04:08,920 --> 00:04:14,920
So post one is going to authenticate user and create review.

57
00:04:15,190 --> 00:04:21,279
So only if the user has logged in, he or she can submit a review.

58
00:04:21,610 --> 00:04:26,380
And when it comes to getting all of them, well, that's going to be a public route online and we want

59
00:04:26,380 --> 00:04:29,680
to go with the router provider that we're out.

60
00:04:30,100 --> 00:04:36,520
And in this case, I'm looking for a forward slash and then I.D. That's going to be my parameter.

61
00:04:36,580 --> 00:04:43,990
Let's just go with get get single review and then the other two, the patch and delete.

62
00:04:44,200 --> 00:04:52,030
Well, for those ones, we first want to use authenticate user, then comma, and then we go with update,

63
00:04:52,360 --> 00:04:54,220
update review.

64
00:04:54,550 --> 00:04:56,770
And the same deal for deleting.

65
00:04:57,340 --> 00:05:04,450
So we're going to go here with authenticate user and then a comma and delete the tweet review.

66
00:05:04,900 --> 00:05:11,740
And once we have all of this in place, we simply go with the module, not exports, not as equal to

67
00:05:11,740 --> 00:05:13,000
a router, of course.

68
00:05:13,870 --> 00:05:21,430
And then lastly, let's hop to jazz where we have all the routers right over here.

69
00:05:22,410 --> 00:05:23,640
Let's write a review.

70
00:05:24,740 --> 00:05:32,070
Review Water is equal to a review route for its large review routes, learn where.

71
00:05:32,150 --> 00:05:33,200
Scroll down here.

72
00:05:33,830 --> 00:05:35,000
Copy and paste.

73
00:05:35,720 --> 00:05:41,000
And we go here with reviews, reviews and it's going to be a review.

74
00:05:42,210 --> 00:05:43,490
You were out.

75
00:05:44,140 --> 00:05:49,510
Now we just need to hop over to a postman and test out the basic route.

