Videos administration listing
Transcript was automatically generated and may be inaccurate.
-
–
So far we can upload videos to Mux and have Mux process these videos, but we -
–
can't actually -
–
see the videos and their details unless we look in the database. -
–
Let's create a more user-friendly admin panel to list and manage videos. -
–
The first thing we want to do is list videos. -
–
Open up the VideoController class, in its index method, we're going to fetch -
–
all videos -
–
in a paginated list. -
–
We'll then pass the paginated list to a new view. -
–
We'll call this view "admin_videos_index". -
–
Create this view "index.blade.php". -
–
We'll copy the contents of the "create" view. -
–
Change the title. -
–
Instead our form, we will instead iterate over the videos getting passed to the view. -
–
If we go to the browser we should see the name of the videos in the database. -
–
At the minute we only have one. -
–
We can get a better list by using our factories to generate some random videos. -
–
Run "sail tinker". -
–
And we can use our video factory to create some random videos. -
–
Here we'll use our video factory to create 30 random videos. -
–
If we refresh the page, we'll now see a lot more video titles, however we'll -
–
only see -
–
15 at a time. -
–
Let's add some pagination to our view. -
–
We've now got pagination but we need some margin between the actual card and -
–
the pagination -
–
itself. -
–
That's better. -
–
This list of videos isn't very appealing, so let's change it into a table. -
–
We now have the videos listed in the table, but again we'll need to add some -
–
styles to -
–
make it look a bit prettier. -
–
That's better. -
–
Now we've a list the videos, styled in the table, and pagination links. -
–
In the next video we'll build upon this to our screens to edit and delete -
–
videos as well -
–
as publish and un-publish them.