Laravel Nova 3 in Production: One Year Later

Elson Tan
6 min readMay 4, 2021

Laravel Nova was launched back in 2018, a quick admin panel for your Laravel projects, when Taylor announced it, it immediately interest me as I have been struggling with building & maintaining different Admin Panels for different Projects(Backpack, Voyager, even custom made ones), which proves to be technical burden in a long run for production.
I started using it since middle of 2019 in hopes that it can help standardise the Admin Panel for my projects. Initially there was some major issues reported and was still unstable, I never really got to deploying it for production-use until Mid 2020 (v3.x).

Since then, me and my team has been using Laravel Nova for multiple client projects and successfully deployed for production-use in different scale of clients(even big enterprises), one year has passed since and here’s my review on Laravel Nova.

Usages

Before we dive into the review, here’s some of my usages for Nova …

As an Admin Panel

Well thats what Laravel Nova is made for, its to allow you to quickly build an admin panel to control your Laravel application and its data, present quick analytics, and do CRUD operations, thats how it’s used on most of our Projects.

As a CMS

Similar to how Wordpress CMS works, some of our Laravel projects are websites that requires a simple content management tool to modify content on frontend pages.

As a DBMS

Laravel Nova is closer to an actual DBMS than you think, with basic setup CRUD operations on your Laravel Models, it helps users to easily manipulate database data based on your Eloquent Models & their relationships.

(after a year …) My Insights

It’s not that friendly to Non-Technical person

Laravel Nova is built around Laravel core concepts of MVC and Eloquent models & their relationships. Of course Laravel Nova is not intended for non-tech users, well, if you are intending otherwise, you will find hard to explain.

In Example, we have two relationships as below,
A Post has many Comments, but this Comment model can belongs to many other models (Many to Many Relationship), seems pretty clear to you and me. The problem arises when you are trying to explain to users on how to “Attach” a comment to a “Post” model.

What’s “Attach” meant anyway? Can’t I just create a comment alongside a Post, asks the user.

In one of the project, we encountered a similar situation, in the end we had to remove the attach methods and build a custom tool to be shown in the Resource Detailed view, acting like an actual Comment box for end user to use and moderate comments easily without having to understanding the relationships and the attach/detach actions.

There are also certain parts of the panel we need to explain to users as well, for example Lenses, if you have went through Nova’s Documentation (which Laravel Team did a great job at), you would probably understand its usages, for a non-tech or even a new developer, its a foreign term that may be confusing to them especially its presented as a “Lenses” dropdown when you defined a Lens for your Resource.

(Maybe we can separate different resource views with just tabs? Wouldn’t it be less confusing?)

Lens Dropdown

Speed, yep it’s still fast.

You may wonder how fast Nova runs in production, we have a dataset of roughly 100k records, it takes less than a second to load it up. Alongside metrics on such records, its still pretty fast, unless you have complex joins and query and is not using the default metrics provided by Nova. With Nova built with VueJS as a SPA, every page load is snappy, and caching + pagination do help with the loading too. We haven’t really got up to million records to test the response times, feel free to leave a comment if you have experienced.

We would like to highlight when we started testing out Nova we ran into a slow resource loading problem in Homestead environment, but once we deployed it into our production servers or run local environment on Valet running PHP7.4 and XDebug turned off, the problem seems to go away.

(Note: Your server specifications can play a major factor in your application speed as a whole)

Great to get started, hard to customise later on.

Laravel Nova was created to ease the troubles of getting an admin panel setup for your Laravel Project, its direct integration with your Laravel project makes it a peace of cake setting up CRUD operations and allow even your non-technical users to manipulate the data. Problems came when my clients started asking for features out of Laravel Nova capabilities. Here’s some of the top requests from them:

  1. A better charting / analytics on Dashboard, they wanted an even more detailed charting like Bar charts, Donut Charts, advanced analytics with date range filters, we had to resort building a custom Tool that runs ChartJS and custom queries.
  2. Customisable menu items, in the beginning there was no way to customise the menu unless you replace it with an entire new tool just for that section. Later on, Laravel Nova team created Grouped Resources feature, yet we can’t really customise the icons, or even use Lens as resource link. In the end most of our Nova projects rely on this package to create fully customised menus for the admin panel.
  3. Theming, although this feature existed since Nova was introduced, there’s still some problems when we are customising some screens, especially if we were to build custom tools, we had to reuse the existing HTML classes on Nova as Nova is built with a custom TailwindCSS theme (not all TailwindCSS classes are available too). Our theme must be built in accordance to TailwindCSS standards and its just painful if your client wants Bootstrap / other CSS frameworks in Nova.
  4. Custom Modals, one of the most limiting feature in Nova is the modals, there’s really no way to customise the modals in Nova, for instance, a client requires us to display multiple stepped (Wizard like) modal when an action modal opens up, we find it lack of customisability of the modal frustrating and ended up using a custom tool instead (yet another custom tool & we need to follow TailwindCSS classes 🥲).

Managing data consistency at production-level

Given that you have a frontend which talks to your Laravel backend via APIs and a Nova Admin Panel, both are manipulating the database through usage of Eloquent models (or even DB raw queries), how do you ensure your data consistency?

One of the examples we have experienced in production, an admin trigger a change on an Eloquent model, supposedly in frontend logic, when a change to this specific dataset must trigger several other data changes to ensure data is always accurate, but in Laravel Nova, developers may missed out connecting the frontend logics of the post-manipulation actions, causing inconsistencies in data presented at frontend and admin panel.

We believe this issue is not isolated Nova but any applications which has multiple interfaces for data consumption will eventually run into this problem, in our case, both frontend application and Nova admin panel is changing the data, and is running different workflows for any post-actions on the data.

What we did to overcome this was just to introduce event-based architecture. Given a simple scenario of a payment flow, whenever Payment model is updated, supposedly we need to update the Transaction model on the latest payment status and send an email to user. So we created an Event Listener which listens for a PaymentMade event, frontend will fire this event whenever a payment is completed. Meanwhile in Laravel Nova, an admin can manually create a successful Payment record, we created an Eloquent Model Observer for Nova to use when a Payment record is created() or updated() and fire the event.

https://gist.github.com/elsodev/74bcc52892aeedd97250366655b9576a

Conclusion

If you are just targeting to get a simple admin panel setup for your production Laravel projects, Laravel Nova can help you save tons of dev time and allow you to go live quicker; but do keep in mind the caveats mentioned above, I hope that my insights able to help you be ready for any possible (nasty) scenarios that after running in production for a while.

Goodies

Some awesome resources for Nova that helped me and my team get a production-ready Nova admin panel up.

https://novapackages.com/
https://github.com/its-awesome/awesome-laravel-nova
https://www.youtube.com/watch?v=rgbdlVleH0M

--

--

Elson Tan

Full Stack Web Dev // Certified AWS SA // I run a Web Dev Agency (nedex.io). Twitter @elsodev.