Custom admin dashboards

Nova 4 Dashboard Codana Styled

Laravel Nova is a tool to make admin panel development a lot easier. It's definitely not a generator, it's doesn't generate files. It's even not a CMS, a lot of functions that you could expect from a CMS won't be available out-of-the-box, but it's more focused on developers. The best way to describe Nova is like an admin panel tool that makes it easier to make a well styled UI for the backoffice of your product.

Laravel Nova 3.0 vs 4.0

Laravel Nova 3.0 had a lot of useful functionalities:

  • a dozen of premade fields
  • a global search
  • CRUD integration
  • Lenses 
  • Actions
  • ...

But there were also some pains that came from the community. In 4.0 the Nova developers showed that they actually listen and that they want Nova to grow in the direction of that community's use cases.

Custom admin panel?

Contact us so we can make a strong plan together.

Packages/features

Dependent Fields

A good example is the use of dependent fields. The possibility to put your fields in an imaginary container that depends on values of another field.

Until now the only option was to use a package (epartment /nova-dependency-container), it suited everyone's needs and worked perfectly (with even 2.5M downloads on Packagist).

This functionality has now been integrated in the core of Laravel Nova 4.0, so from now on you wouldn't need to depend on the maintenance of a third party package.

Select::make('Purchase Type', 'type')
    ->options([
        'personal' => 'Personal',
        'gift' => 'Gift',
    ]),

// Recipient field configuration is customized based on purchase type...
Text::make('Recipient')
    ->readonly()
    ->dependsOn(
        ['type'],
        function (Text $field, NovaRequest $request, FormData $formData) {
            if ($formData->type === 'gift') {
                $field->readonly(false)->rules(['required', 'email']);
            }
        }
    ),

 

Impersonate menu

Impersonation

Impersonating a user is especially useful for an administrator to be able to approach the interface from the point of view of a certain user. A package that was used a lot for this was KABBOUCHI/nova-impersonate. From Nova 4.0 this will also be an integrated functionality that will be included in the core of Nova. Another dependency that was removed 👌

Mobile Friendly Dark Mode Nova 4

Responsive Design

Nova 4.0 introduces a thoroughly redesigned user interface that is now fully responsive, so you can use your platform on your phone on the go.

Also one of the most requested styling features was implemented: "dark mode"!

Branding Nova 4 Codana Styled

Painless Branding

A new branding option has been added to the Nova configuration so that you can easily customize the "primary colors" and logo used in the Nova interface without having to create a custom Nova "theme".

Laravel Nova 4 Codana Styled Sidebar

Custom Menus

There is now also support for a fully customizable sidebar and user menu. In fact, you can fully customize every item in Nova's navigation (left sidebar), including creating menu sections, menu groups, and more. Previously, this also required a package to be able to do this, such as digital-creative/collapsible-resource-manager.

Upgrades

Laravel-mix

Laravel Nova has been around for a long time and Laravel Mix was never updated in that time, so there is now a big catch-up from v1 to v6.

Tailwind 3

In Nova 3.0 Tailwind CSS 0.6.0 is still used, here too there will be an upgrade: Tailwind CSS 3!

Inertia.JS

Inertia implements a new approach to building classic server-driven web apps. Inertia makes it possible to create fully client-side rendered, single page apps without the complexity that usually comes with modern SPAs. It does this by leveraging existing server-side frameworks. Inertia has no client-side routing, nor does it require an API. Easily build controllers and page views like you always have!

Not a framework

Inertia is not a framework, nor is it a replacement for your existing server- or client-side framework. Rather, it is designed to work with them. Think of Inertia as glue that connects the two. Inertia does this via adapters. There are currently three official client-side adapters (React, Vue, and Svelte) and two server-side adapters (Laravel and Rails).

Example in Nova 4.0

You will especially notice the use of Inertia.js if you're going to make custom tools that use the Vue router. Nova has therefore replaced the Vue router with Inertia.js. As a result, when you upgrade to 4.0 and higher, you will have to migrate custom tools from Vue routes to registering Inertia page components and backend routes.

As an example we have a Nova 3 Vue router registration:

// In tool.js...

Nova.booting((Vue, router) => {
  router.addRoutes([
    {
      name: 'sidebar-tool',
      path: '/sidebar-tool',
      component: require('./components/Tool'),
    },
  ])
})

When we upgrade to Nova 4, you will need to register the tool components as follows:

// In tool.js...

Nova.booting((Vue) => {
  Nova.inertia('SidebarTool', require('./component/Tool').default)
})

Once your Vue component is registered, you will need to define a server-side route for your tool to render your component:

// In ToolServiceProvider.php...

use Laravel\Nova\Nova;

Nova::router()
    ->group(function ($router) {
        $router->get('sidebar-tool', function ($request) {
            return inertia('SidebarTool');
        });
    });

 

Author: Noah Gillard
PHP Developer
Noah Gillard

More insights

Life as a React developer at Codana: 1 year in service

"You can start working with us as a React developer!". Bliss! Needless to say, I was super happy to hear this! But, I had never written a line of React before.

Author: Thomas Timmermans
Frontend Developer
Thomas Timmermans
Ik na 1 jaar in dienst

The ideal first workplace

I'm Ward Vandevoort, 22 years old and early November 2021 I started at Codana as a junior backend developer. Discover my story at Codana!

Author: Ward Vandevoort
Developer
Ward Vandevoort
groepsfoto

Teambuilding

We have a great teambuilding in Antwerp!

Author: Noah Gillard
PHP Developer
Noah Gillard
groepsfoto codana burgerij

Laracon Online Winter 2022

This is what we learned

Author: Tom Van den Eynden
Senior PHP developer
Tom Van den Eynden
Laracon winter 2022 Codana Banner

How to generate PDFs in your PHP web application

Author: Sarah Jehin
PHP developer
Sarah Jehin
code

Say hello to Laravel 9!

You read it right, Laraval 9 is available! 🚀

Author: Tom Van den Eynden
Senior PHP developer
Tom Van den Eynden
Laravel 9