Purchase access to watch this video.

Unlock course for £159

Already purchased access? Login

Videos administration listing

  1. So far we can upload videos to Mux and have Mux process these videos, but we
  2. can't actually
  3. see the videos and their details unless we look in the database.
  4. Let's create a more user-friendly admin panel to list and manage videos.
  5. The first thing we want to do is list videos.
  6. Open up the VideoController class, in its index method, we're going to fetch
  7. all videos
  8. in a paginated list.
  9. We'll then pass the paginated list to a new view.
  10. We'll call this view "admin_videos_index".
  11. Create this view "index.blade.php".
  12. We'll copy the contents of the "create" view.
  13. Change the title.
  14. Instead our form, we will instead iterate over the videos getting passed to the view.
  15. If we go to the browser we should see the name of the videos in the database.
  16. At the minute we only have one.
  17. We can get a better list by using our factories to generate some random videos.
  18. Run "sail tinker".
  19. And we can use our video factory to create some random videos.
  20. Here we'll use our video factory to create 30 random videos.
  21. If we refresh the page, we'll now see a lot more video titles, however we'll
  22. only see
  23. 15 at a time.
  24. Let's add some pagination to our view.
  25. We've now got pagination but we need some margin between the actual card and
  26. the pagination
  27. itself.
  28. That's better.
  29. This list of videos isn't very appealing, so let's change it into a table.
  30. We now have the videos listed in the table, but again we'll need to add some
  31. styles to
  32. make it look a bit prettier.
  33. That's better.
  34. Now we've a list the videos, styled in the table, and pagination links.
  35. In the next video we'll build upon this to our screens to edit and delete
  36. videos as well
  37. as publish and un-publish them.
Connect GitHub