In this episode, we kick things off by putting together a really basic starter app. If you’ve already got your own app and don’t feel like following along at this stage, feel free to skip ahead—but if you want the full walkthrough, stick around!
We start with a fresh Laravel Breeze project using Inertia and set up the foundation for a simple file listing app. The goal for this episode is to get a basic dashboard that just shows the files from our database.
We keep things nice and simple: create a File
model and migration, set up a migration with a user_id
(for associating files with a user) and a path
field to record where each file is stored. After running the migrations, we establish the relationship on the User model so users can have many files.
From there, we swap the dashboard view from a closure route to a dedicated controller (to keep things organized as the app grows). Instead of getting fancy with resources or API formatting, we just grab all of the authenticated user’s files, order by latest, and pass them straight down to our dashboard view.
On the front end, we loop over the files and show a simple list, or a message if there aren’t any files yet. We wrap up the episode by quickly adding some test data in the database to make sure everything’s working, and confirm that the file list is being displayed.
And that’s the setup! The rest of the course will take things further by building out the actual upload functionality, but now we’ve got a working base to build on.