read-rate/nova-model-settings-field

A model-settings field for Laravel Nova

1.0.2 2020-10-21 10:27 UTC

This package is auto-updated.

Last update: 2024-04-21 17:57:24 UTC


README

Latest Version on Packagist Total Downloads

This package contains a Nova field to add settings to your models using the laravel-model-settings.

Requirements

This Nova field does not support v4.0.0 of laravel-model-settings yet.

Installation

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

composer require read-rate/nova-model-settings-field

Usage

To add settings to a model you first need to make sure that one of the HasSettingsField, HasSettingsTable, HasSettingsTrait trait is present.

class Book extends Model
{
    
    use Glorand\Model\Settings\Traits\HasSettingsField;
    
    ...
}

Next you can add the new model-settings field to your Nova resource :

namespace App\Nova;

use Readandrate\ModelSettingsField\ModelSettingsField;

class Book extends Resource
{
    // ...
    
    public function fields(Request $request)
    {
        return [
            // ...
            
            ModelSettingsField::make('Model Settings'),

            // ...
        ];
    }
}

Testing

composer test

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email donatien@schmitz.cc instead of using the issue tracker.

Credits

License

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