How to install Laravel Nova via Composer & API Token

What is Laravel Nova

Laravel Nova is a powerful tool for creating admin panels for your Laravel projects.

Configure composer.json to install Nova

To install Nova you need to add following instructions into you composer.json file:

"require": {
    "laravel/nova": "~3.0",
    ...
},
...
"repositories": [
    {
        "type": "composer",
        "url": "https://nova.laravel.com"
    }
]

Here we tell composer to add Nova package into our project and where composer can find this package.

Create auth.json

If you add these lines and run composer update immediately, than you will see your composer asking your credentials to auth:

Composer ask for credentials

It is better to tell composer use API token. Let’s create auth.json file and put it near composer.json. File contents will be like this:

{
    "http-basic": {
        "nova.laravel.com": {
            "username": "[email protected]",
            "password": "PUT YOUR TOKEN HERE, NOT REAL PASSWORD"
        }
    }
}

You can find your API token on password page:

Laravel Nova Token on password page

Official composer documentation recommends to add auth.json file to .gitignore. Be careful with it!

Run composer update

Run composer update command after creating auth.json file.

Leave a Reply

Your email address will not be published. Required fields are marked *