Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,440 --> 00:00:04,760
Now let's move the existing post route handlers to the PostController.
2
00:00:05,140 --> 00:00:10,030
These two routes are already defined within the resource routes, so all we
3
00:00:10,030 --> 00:00:14,640
need to move are the callback functions. Copy the contents of these
4
00:00:14,640 --> 00:00:17,860
functions to the appropriate PostController actions.
5
00:00:18,740 --> 00:00:22,660
The create action just needs to render the create template.
6
00:00:22,970 --> 00:00:26,800
The store action validates the input from the injected request
7
00:00:26,800 --> 00:00:30,480
object and redirects the user back to the form.
8
00:00:30,770 --> 00:00:34,780
The great thing is we can leave all of this code as it is.
9
00:00:34,790 --> 00:00:36,460
We don't need to change anything.
10
00:00:36,840 --> 00:00:40,460
This route will still work because the route name provided by
11
00:00:40,460 --> 00:00:43,570
the resource method is still posts.create.
12
00:00:43,880 --> 00:00:45,400
If you want to make sure of that,
13
00:00:45,410 --> 00:00:48,500
you can again run the artisan command for listing all of the
14
00:00:48,500 --> 00:00:51,980
routes and their respective names. And that's it.
15
00:00:51,990 --> 00:00:56,510
The transition was really easy because we already used all of the best naming
16
00:00:56,510 --> 00:01:00,660
practices. In the next module, we will start implementing the rest of the
17
00:01:00,660 --> 00:01:05,519
controller actions, and we will also actually store the post to the database
18
00:01:05,530 --> 00:01:08,060
instead of just having this flash message.1654
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.