codebar-ag/laravel-default-nova

Boilerplate integration for Laravel Nova Projects at codebar Solutions AG.

v2.0 2024-02-09 10:05 UTC

README

68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f6c61726176656c2d64656661756c742d6e6f76612e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d636f64656261722d61672532466c61726176656c2d64656661756c742d6e6f7661267061747465726e3d617263686974656374267374796c653d7374796c655f32266465736372697074696f6e3d426f696c6572706c6174652b696e746567726174696f6e2b666f722b4c61726176656c2b4e6f76612b50726f6a656374732b61742b636f64656261722b536f6c7574696f6e732b41472e266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667

laravel-default-nova

Latest Version on Packagist run-tests PHPStan GitHub Code Style Action Status Total Downloads

Installation

You can install the package via composer:

composer require codebar-ag/laravel-default-nova

NovaServiceProvider

<?php

namespace App\Providers;

use CodebarAg\LaravelDefaultNova\Providers\CustomNovaServiceProvider;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Gate;
use Laravel\Nova\Nova;

class NovaServiceProvider extends CustomNovaServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        parent::boot();
    }

    /**
     * Register the Nova routes.
     *
     * @return void
     */
    protected function routes()
    {
        Nova::routes();
    }

    /**
     * Register the Nova gate.
     *
     * This gate determines who can access Nova in non-local environments.
     *
     * @return void
     */
    protected function gate()
    {
        Gate::define('viewNova', function ($user) {
            return Auth::check();
        });
    }

    /**
     * Get the dashboards that should be listed in the Nova sidebar.
     *
     * @return array
     */
    protected function dashboards()
    {
        return [
            new \App\Nova\Dashboards\Main,
        ];
    }

    /**
     * Get the tools that should be listed in the Nova sidebar.
     *
     * @return array
     */
    public function tools()
    {
        return [];
    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        parent::register();
    }

}

Config

<?php

return [

    'prevent_lazy_loading' => app()->isLocal(),
    'with_breadcrumbs' => true,
    'without_notifications' => false,
    'resource_in' => 'Nova/Models',

    //'initial_path' => '/resources/users',
    //'assets' => ['js/nova.js', 'css/nova.css'],

    'policies' => [
        'namespace' => 'App\\Policies\\Nova\\',
    ],

];

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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