ijpatricio/nova-larastan-tool

A Laravel Nova tool.

v0.1.7 2018-09-12 13:38 UTC

This package is auto-updated.

Last update: 2024-12-11 03:30:55 UTC


README

Run Larastan right from your Laravel Nova application

nova_larastan screenshot

Installation

You can install the package in to a Laravel app that uses Nova via composer:

composer require ijpatricio/nova-larastan-tool

Next up, you must register the tool with Nova. This is typically done in the tools method of the NovaServiceProvider.

// in app/Providers/NovaServiceProvider.php

// ...
public function tools()
{
    return [
        // ...
        new \Ijpatricio\NovaLarastanTool\NovaLarastanTool(),
    ];
}

As Larastan is mainly for a dev environment, to keep the dependencies dev only, you can setup previous tools() method as following:

public function tools()
{
    $tools = [
        //... your regular tools
    ];

    if (app()->environment() === 'local') {
        $tools = array_merge($tools, [
            //... your require-dev tools
            new \Ijpatricio\NovaLarastanTool\NovaLarastanTool()
        ]);
    }

    return $tools;
}

Usage

Click on the "Analyse code" button. That's it.

If Larastan is not installed, you will instead see something like this:

nova_larastan screenshot

Go to LarastanGithubRepository for installation details.

Changelog

Please see CHANGELOG for more information what has changed recently.

Security

If you discover any security related issues, please email ijpatricio (at) gmail dot com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.