In this episode, we dive into building the ability to update videos that we've previously captured. Here's what we work on:
First, we set up the routing and controllers so you can click any video to view its dedicated page. We make sure that you can actually see the video (with a working player!), and then begin working on enabling users to update key details like the title and description. We wire up the necessary Inertia and Vue components and reuse some of the markup from our "create video" page so things look familiar and consistent.
Next, we make sure the updates submit to a new controller, handle saving the changes, and provide instant feedback when the update is successful — so users know their edits have been saved. We even add a little animated message that shows when the video is saved, which disappears after a short time.
Security is really important, so we also introduce authorization policies. We create a new policy to ensure only the owner of a video can view or update it. Then, we move some of the authorization logic into form requests, keeping the controllers neat and tidy.
By the end, we've got a complete workflow: viewing, updating, and securing access to videos — all wrapped up with pleasant UX touches. Next up, we'll look at generating shareable links for these videos!