aberbin96/nova-promocodes-4

A Laravel Nova tool.

dev-main 2023-11-17 17:34 UTC

This package is auto-updated.

Last update: 2024-05-17 18:55:27 UTC


README

Adaptation of the promocodes library for laravel nova 4.

Nova 3 version: https://github.com/zgabievi/nova-promocodes

Configuration

    php artisan vendor:publish --provider="Aberbin96\NovaPromocodes\ToolServiceProvider"

Now you can change configurations as you need:

    return [
        'models' => [
            'promocodes' => [
                'resource' => \Aberbin96\NovaPromocodes\Resources\Promocode::class,
            ],

            'users' => [
                'resource' => \App\Nova\User::class,
            ],
        ],
    ];

After you configure this file, run migrations:

    php artisan migrate

Include Tool

Include promocodes tool inside nova service provider.

use Aberbin96\NovaPromocodes\PromocodesTool;

class NovaServiceProvider extends NovaApplicationServiceProvider
{
    // ...

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

Parent Package

For more information about parent package, visit zgabievi/laravel-promocodes.

Credits