Laravel Nova Mastery
Laravel Nova is the fastest way to build a full-fledged administration panel for your Laravel applications. Now in its fourth major iteration, it's more powerful than ever! Curious? Join me as we build out an admin panel together and take a look at everything Nova has to offer.
Progress
Series Info
- Episodes
- 25
- Run Time
- 3h 43m
- Difficulty
- Advanced
- Last Updated
- Aug 31, 2023
- Version
- Latest
Series Episodes
- Nova Basics (4)
Say Hello To Nova
Welcome to Nova, an outstanding administration panel for Laravel, by Laravel. Let's talk briefly about Nova's mission statement, and what we'll be building using it in this series.Install and Configure Nova
As Nova is a paid product, its installation steps are slightly different from your run-of-the-mill Laravel package. Let's take a look at the steps we'll need to perform before we start using Nova.Customize Laravel Nova Branding
Whilst you should generally leave styling to Nova, it does provide easy configuration to officially make it 'yours'. Let's customize Nova so that it matches our Library's branding.Your First Resource
At the core of every Nova project are Resources, and at the core of every library are books! Let's explore the basics of resources in Nova by building one to represent our `Book` model.
- Getting A Feel For Fields (3)
What's In A Field?
So far, the fields in our `Book` resource are a little rough around the edges. Thankfully, Nova allows us to configure all fields using a predictable, declarative API. Let's explore some of the options before we dive any deeper.A Smorgasbord Of Options
You should never judge a book by its cover, but it would be nice to at least see the cover for our Library! Let's explore just a few of the massive variety of field types Nova ships with.Validating Fields
Nova really has made all our CRUD operations a cinch, but it's not magic; if you put bad data in, you'll get bad data out. To prevent that, we need to validate input, just as you would in a Laravel controller. Let's see how we can implement familiar validation rules, Nova style.
- Serious About Relationships (4)
Simple Relationships
Alright, it's time to turn up the heat. OurBookResource is all alone, but in reality it has many relationships: an author, a publisher, audio recordings… you get the idea. It's laughably simple to add relationships to our admin panel, so let's do it!Depending On Other Fields
We've hit a roadblock - the options that should be available for sub-genre depend on the selected genre. We're in luck, however: Nova makes it a breeze for one field to depend on the value of another. Let's see how in this episode.BelongsToMany And Polymorphic Relationships
Now that we have a handle on simple relationships, we can turn our attention to more complex examples and see how Nova let's us work with custom pivot tables and polymorphic data.Spice Up Your Relationships
Our admin panel is really starting to take shape! It's still a little clunky in places though, especially when it comes to creating new resources. Let's utilize a few Nova tricks to iron out the kinks.
- Resource Insights (5)
What's On The Menu?
So far, we've allowed Nova to manage our navigation menu, but things are starting to look a little cluttered. Thankfully, its simple to introduce our own custom menu structure.Search And Scout
We've already briefly discussed the$searchproperty, but we've only just scratched the surface. Let's look at how we can find anything instantly using Nova's powerful search tool integrations.Let's Build A Filter
Though search gets us a long way, sometimes you just want a filtered index. We've already looked at simple field filters, but what if you want something more custom? No sweat!Use Lenses For A New Perspective
Resources are great, but sometimes you require a custom index with custom columns for more specific use cases. We can transform our index to suit our needs using a neat feature called Lenses, so let's create aStockview for ourBookResource.Metrics Add Meaning
Can you believe we're this far into a series about admin panels and haven't so much as mentioned a line chart? Let's fix that using Nova's simple-yet-versatile metric tools.
- Taking Action (4)
Building A Basic Action
Actions allow us to perform custom logic to do just about anything we can think of at the click of a button. In our case, we'll use them to make managing reviews a cinch for our administrators.Actions With Input
More often than not, you'll need some additional details from the user before running an action. We've already looked at many of the fields Nova offers, so let's now see how we can use them to pass information into an action.Managing Long Running Actions
If your action takes a while to run, the last thing you want is to sit in front of the screen waiting for it to complete. Instead, let's see how we can defer actions to Laravel's queue, and how we can batch related queued actions together.Authorize Everything
So far, all users of our admin panel can see all data and run any action. You probably don't want that, so let's see how Nova seamlessly integrates with Laravel's authorization features to allow us to scope access.
- Going Super Nova (5)
Nova Notifications
See that bell icon? Well, Nova has its very own notification tray where we can update administrators on important changes to our application. Let's see how to build Nova notifications and dispatch them from anywhere.Custom Fields
Almost all of your field requirements will be covered out of the box. Occasionally though, you'll want to reach for something a little more custom. Let's build a fun little 'star indicator' for our review resource.Custom Cards
We've played a little with cards already; every Nova metric is presented in a card at the top of the page. Did you know you can build your own cards that can contain anything you'd like? Let me show you.Custom Tools
When your app needs to go beyond CRUD, Nova travels with you. Custom tools give you the ultimate freedom to build anything you'd like, whilst still staying within the chrome of Nova.Before You Go Live…
Well done, you're now a Nova Master! With your learnings from this series, you have everything you need to build awesome admin panels. There are a couple of things you should do before hitting deploy, so let's briefly tackle them before we wrap things up.
