Technology Blog

Look deep into latest news and innovations happening in the Tech industry with our highly informational blog.

Getting started with Laravel Nova

hkis
Laravel Nova, the latest addition to the Laravel ecosystem has arrived. So, what exactly is it?

Well, straight from the marketing website it’s defined as, “a beautifully designed administration panel for Laravel. Carefully crafted by the creators of Laravel to make you the most productive developer in the galaxy.” It can be everything from an admin panel to a CMS to a CRM, and I’m just scratching the surface. It’s rocket fuel for your Laravel projects that lets you focus on the features that matter to your users.

Laravel_Nova_img

Features of Nova

  • Resource Management: Allows for quick integration of your models to your dashboard. It supports all Eloquent relationships including pivot tables.
  • Actions: Actions are PHP tasks that you can run against a resource or batch of resources. Have an action that takes a while? No problem, Nova’s queued actions will keep your administration panel feeling snappy.
  • Filters: Write custom filters for your resource indexes to offer your users quick glances at different segments of your data. To get you started, we’ve included built-in filters for “soft deleted” resources.
  • Lenses: Need to customize a resource list a little more than a filter can provide? No problem. Add lenses to your resource to take full control over the entire Eloquent query.
  • Metrics: Nova makes it painless to quickly display custom metrics for your application, allowing you to generate three types of graphs in seconds. To put the cherry on top, we’ve included query helpers to make it all easy as pie.
  • Authorization: Nova is beautifully integrated with Laravel’s existing authorization policies. Let your Nova resources automatically leverage your existing application policies to determine a user’s abilities. Fine-grained authorization support is even provided for relationships, tools, actions, lenses, and fields.
  • Custom Fields: Need a field type that isn’t included with Nova? No problem – use the Nova CLI to generate a custom field and take total control over its implementation and design.
  • Scout search integration: Feel the power of the Laravel ecosystem by linking your Nova administration panel with Laravel Scout. Once you do, you’ll get blazing fast search results powered by Algolia and the cloud.
  • Custom Tools: Nova offers CLI generators for scaffolding your own custom tools. We’ll give you a Vue component and infinite possibilities. Build the custom tools your business requires, or build the next great Nova add-on and share it with the world.

Getting Started

First things first, you’ll need to head over to the Nova website and register for an account. Once you’re in, you’ll need to purchase a license to get access to the code.

Once you have a license, you can download the Nova files to your machine. Next, create a new Laravel project using laravel new <your-project-name> or you can add it to an existing project. From the command line, I used mv <path-to-nova-download> <path-to-my-project-nova-directory> to add it. This way, I was sure to include all of the hidden files like the .gitignore

Project Installation

With the source code in place, you can configure your composer.json to recognize Nova by adding this snippet:

&quot;repositories&quot;: [
    {
        &quot;type&quot;: &quot;path&quot;,
        &quot;url&quot;: &quot;./nova&quot;
    }
],

Then, you’ll add Nova to the require section of composer.json like this:

&quot;require&quot;: {
    &quot;php&quot;: &quot;^7.1.3&quot;,
    &quot;fideloper/proxy&quot;: &quot;^4.0&quot;,
    &quot;laravel/framework&quot;: &quot;5.6.*&quot;,
    &quot;laravel/nova&quot;: &quot;*&quot;
},

Before running the installation commands, make sure you configure your DB in your .env.

With that setup, you can run the following commands from your terminal to install Nova:

    composer update
    php artisan nova:install
    php artisan migrate

Bada bing bada boom, Nova is now installed in our project! We can now navigate to the /nova route and see the login screen.

laravel_nova_login _login

pics courtesy: medium.com

Add Your First User

To log in, we need to create a user. Nova includes an out-of-the-box command so we can register anyone on the fly. We can run php artisan nova:user in our terminal and follow the prompts to add our first user. Now, we’re ready to log in and start our blog!

laravel_nova

pics courtesy: medium.com

For more Information and to build a website using Laravel, Hire Laravel Developer from us as we give you a high-quality product by utilizing all the latest tools and advanced technology. E-mail us any clock at – hello@hkinfosoft.com or Skype us: “hkinfosoft“.

To develop the custom website using Laravel, please visit our technology page

Content Source:

  1. medium.com