Laravel Nova vs Laravel Backpack: a review of the features

Could Nova be the successor of Backpack? Are the two products complementary? As usual, everything is in the details. Let’s compare them.

Laravel Nova has been released late August 2018 with a great enthousiasm from the Laravel community, despite its price. I immediately bought it, to see if it can replace what I used until now: Laravel Backpack. I tested also other “admin panels” products, such as Laravel Voyager or Laravel Admin Architect, but I always came back to Backpack. This time, with Nova, I was sure that it will be a great competitor. Let’s assess this concretely.

Installation & First feelings

The installation is easy for both products. I had no problem, even the first time I did it. The default theme of Laravel Nova is much more beautiful than Laravel Backpack, but as a default theme is made to be customized this is not a big deal.

Laravel Nova — The login page
Laravel Backpack — The login page

The only little thing that surprised me with Nova is the lack of register link on the homepage. It might be a deliberate choice as this is an admin panel and not a user one.

Except that, no issue to underline.

Backpack Crud vs Nova Crud: two approaches

To create a CRUD with Nova, you just have to make a “Resource”, which is a class gathering the whole configuration of your CRUD in one place. Once this class is written (it is very fast), everything is done automatically:

  • A item is added in the left menu
  • The routes are set up
  • The table listing entries can be displayed, as well as the form to enter data.

In short: you have almost nothing to do to have a nice working CRUD for a model, which is great.

The loading of these Resources is made automatically by Nova, provided that your classes are located in the folder app/Nova. Fortunately, as mentioned in the manual, Nova has a mechanism to load manually the classes you want, whatever their location. This is a very important feature as a simple scanning of one folder would break the possibility to adopt another application design, such as the modular one provided Laravel-modules by Nwidart. This mistake has been made by some other admin panels, like AdminArchitect where I didn’t find a way to add directories from where to load the CRUD classes.

In the other hand, Laravel Backpack does not scan anything. You have to use your resources (called CrudControllers) as all other controllers: you need to set up the route manually, and set the item in the menu.

So, here, we have two different approaches: Nova’s philosophy is to perform a lot of stuff in the background, which may impact its flexibility, while Backpack is more manual but likely easier to customize.

The navigation

Laravel Backpack provides has a navigation menu that you can fully customize, directly by editing the published view (sidebar_content.blade.php):

<li>
<a href=”{{ backpack_url(‘documents’) }}”>
<i class=”fa fa-files-o”></i>
<span>@lang(‘Documents’)</span>
</a>
</li>

Laravel Nova adds a menu item automatically for each resource found, ordered alphabetically.

@foreach (Nova::availableResources(request()) as $resource)
<li class=”leading-wide mb-4 text-sm”>
[... menu code ...]
</li>
@endforeach

But don’t worry, you can easily create a resources/navigation.blade.php in your views folder to customize the navigation exactly as you want.

To conclude, Nova is slightly better for the navigation as it can create menu items and routes automatically, but both products offer the same customization levels for the menu.

The table view

First, two screenshots, one with Laravel Backpack with a model called Vulnerability, and one with Nova and a model called “Document”.

Laravel Backpack — Crud List view
Laravel Nova — Crud List view

Both products are “nice to see”. The presentation is clean. Nova seems a bit more modern but this is a question of taste. However, there are big differences in the features proposed. I will try to list the ones that can be a deal-breaker for your projects, in one way or another.

Nova: no export function

With Nova, you cannot export the data from the list. I was very surprised to see that, I think it is an important feature. Of course, you can develop what it called (in the Nova-world) a custom “action” for that, but it will add some work to do.

Nova: adding custom actions
Laravel Backpack: native functions to export data

Laravel Backpack: no multiple-rows selection

Yes, it is incredible, there is still not any mean to select multiple rows and to apply an action to them (such as delete…). I never understood why this is not the top-priority, and I am not alone I think.

Update of August 26, 2018: Laravel Backpack announced a patch to implement this feature (see comments of this article).

Filters are nicer with Backpack

I dislike the way and the presentation of filters in Nova. To define your filters, you have to create a Filter class for each field. Furthermore, the presentation of filters is not practical at all: everything is available by clicking on the filter icon, and then all filters are displayed. I dislike it because there are lot of empty spaces in the table, and this space is not used even on a wide screen.

One Nova Filter

Furthermore, it seems you cannot define a “text” filter (you just enter a text to filter rows).

In Backpack, filters can be implement with less work. No need to have one file/class per filter, everything is in the CrudController:

$this->crud->addFilter([ // dropdown filter
'name' => 'status',
'type' => 'dropdown',
'label'=> 'Status'
], [
1 => 'In stock',
2 => 'In provider stock',
3 => 'Available upon ordering',
4 => 'Not available',
], function($value) { // if the filter is active
// $this->crud->addClause('where', 'status', $value);
});

You have several types of filters (text-based, toggle-based, select-based, and even select2-based which is basically a searchable select field, date and date-range filters).

Laravel Backpack — Select2 filter
Laravel Backpack date-range filter — Amazing feature :-)

In addition, the presentation of the filters is more intuitive in Backpack, even if it is a personal taste:

Laravel Backpack filters are intuitively on top of the table

For this part, Laravel Backpack is a big winner.

Nova lenses: a very good concept

Nova offers the possibility to configure custom views (called lenses) of any CRUD table. This is really a great concept. There is an artisan command to create these lenses, and the overall result is very nice:

Custom view of the User model: showing the “most valuable users”

In Backpack, this feature is not so direct. The best option to do it would probably to use the filters as they offer a great customization, and the callback function is exposing the full CRUD object so you can add all clauses you want to your eloquent query and add/remove columns. This has not been tested but at a first sight it should work.

$this->crud->addFilter([ // select2 filter
'name' => 'status',
'type' => 'select2',
'label'=> 'Status'
], function() {
return [
1 => 'In stock',
2 => 'In provider stock',
3 => 'Available upon ordering',
4 => 'Not available',
];
}, function($value) { // if the filter is active
$this->crud->addClause('where', 'status', $value);
$this->crud->addColumn(...) // Should work
$this->crud->removeColumn(...) // Should work
});

Laravel Backpack: do you like buttons?

With Backpack, you can add many buttons. Everywhere. Above the table, below the table, in each rows, and so on. Each one can do whatever you want: going to a new route, or perform client-side stuff with Javascript/jQuery.

With Nova, this seems not supported yet. Backpack is a winner on this feature. This is clearly a killer-feature as I wonder how you can make a good application without adding on or more buttons, especially at the row level.

Customizing columns format

With Backpack, you can also customize the format of the content of a column, for instance to have a custom condition like: “if the value is 1, then set the text color in red”. This can be achieved with two different mechanisms:

I am not a fan of the first possibility, it always seems strange to add a Model function just to format the content, it breaks the MVC principles, but as there is another option — which seems more healthy — that’s fine.

What about Nova? Here I had a very bad surprise. You can indeed format as you want any column with the displayUsing function. But with a big limitation.

Here is the code:

/**
* Get the fields displayed by the resource.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function fields(Request $request)
{
return [
ID::make()->sortable(),
Text::make(‘Title’)->sortable()->displayUsing(function ($value) {
        // Let's try that! 
return ‘<b>’.strtoupper($value).’</b>’;
       }),
      Textarea::make(‘Description’)->sortable(),
   ];
}

And the unexpected result:

Nova: how I can customize column format?

This is a bit surprising, I think this is a bug and not a feature. Too much security here.

Winner: Backpack.

Revisions: easy with Backpack!

Laravel Backpack provides a way to display a “revisions” button on each row, leading to a screen that displays the… revisions of the record:

Laravel Backpack Revisions — Great feature

Nova does not propose such a feature.

Responsive tables

The CRUD list view of both products is responsive. However, Backpack has added an interesting option to let the user choose which columns will be hidden on small screens.

Previewing rows

Nova and Backpack has a preview button, to show a record without editing.

The edit/add forms

Let’s dive into the edit/add forms. First, something to have in mind: I didn’t test all field types, and I didn’t even compare them as it will be too long.

For the edit/add forms, here what I noted:

  • Both products support all kinds of relations (1-N and N-N with pivot tables).
  • The edit form is nice on both products
  • Nova proposes the field panels, which is very great for long forms. For Backpack, it is a bit different, it can be implemented through tabbed forms.
Laravel Nova Field Panel, useful for long forms
Laravel Backpack — Tabbed form
  • Validation rules: both products are supporting rules to define the requirements of each field, and they support inline errors as well. However, for Nova, required fields are not marked with a typical red star.
Text::make(‘Title’)->sortable()->creationRules(‘required’, ‘string’, ‘min:6’),
Textarea::make(‘Description’)->sortable(),

This code will produce the following form:

Laravel Nova: fields marked as required do not have a red star

The “red-star” feature has been implemented recently in Backpack, and now all required fields have a distinctive mark, as described in the July 2018 Backpack newsletters.

  • For the supported fields, I think Backpack and Nova are supporting a lot of field types, which should be enough for most of the applications. In addition, both enable the developer to make custom fields, so no issue at this level.
  • Laravel Nova implemented a very interesting feature: the automatic display of related models.
Laravel Nova: automatically displaying related models of a record

However, this is not clear if this can be customized or even removed, as it is based on the relationships of your models.

In Laravel Backpack, such a feature is not available, and you will have to make the related views of any model manually.

Dashboard, Cards and Metrics

Nova offers cards, which can be understood as widgets for any dashboard, showing statistics and charts, and metrics to compute easily these charts.

These are a good feature that should be underlined, as this is clearly an important added-value of Nova.

A Laravel Nova metrics in a card

Laravel Backpack does not have this feature, you will have to develop it manually using external libraries and charts modules. I think this is one of the main criteria which will convince a lot of developers to use Nova.

Summary: Nova or Backpack?

This review covers only a small percentage of the features proposed by both products, but I think it is a good overview of their pros and cons.

To summarize and to help you choose between the two, here are the pros and cons to use Nova instead of Backpack.

Pros:

  • Easy to use, clear and clean syntax.
  • Dashboard / Metrics / Cards
  • Related models displayed, but questions about the customization
  • Concept of CRUD list custom views (Lenses)
  • Field Panels for long forms
  • Multiple-rows selection supported (shame on Backpack on this point :))

Cons:

  • Less customization than Backpack
  • No export function
  • No HTML/CSS conditional customization of columns
  • No distinctive sign to show required fields in forms
  • Filters are less intuitive / less flexible
  • No native support of revisions
  • No native way to add buttons (per row notably)
  • No customization of the responsiveness of the tables

In short, if your admin panel stays simple, without too much customization, Laravel Nova can be a great product as it will enable to develop fast with a convincing result. However, as soon as you will need to perform sophisticated things, Laravel Backpack will be more adapted to your needs.

Clearly, Backpack has an edge on most features because it is older and well maintained. However, Nova is refreshing and comes with very interesting features that should inspire Backpack.

For now, I will stick to Backpack on my side, but I will keep a look on Nova as it may develop quickly. Nova is already not far away of Backpack: with a bit more customization mechanisms and small details solved it will be a great competitor to Backpack with extremely interesting features and a care to stay clean and user-friendly.

Thanks and disclaimers

Thanks to the developers of these two products, and especially Cristian Tabacitu (Laravel Backpack) for his work and advantageous licensing plan. Good luck to Taylor Otwell for his new product and thanks for him for Laravel, but also for Nova which brings new ideas.

Most of screenshots of these articles come from the manual pages of both products. The author is not affiliated to any of them.

If you see any error in this article, feel free to comment, I will correct it.