PHPackages                             crayon/nova-settings - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. crayon/nova-settings

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

crayon/nova-settings
====================

A Laravel Nova tool for editing custom settings using native Nova fields.

3.1.4(4y ago)04MITPHPPHP &gt;=7.2.0

Since Aug 13Pushed 4y agoCompare

[ Source](https://github.com/crayon1337/nova-settings)[ Packagist](https://packagist.org/packages/crayon/nova-settings)[ GitHub Sponsors](https://github.com/optimistdigital)[ RSS](/packages/crayon-nova-settings/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (6)Versions (37)Used By (0)

Nova Settings
=============

[](#nova-settings)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1079355cba76860f36895fdc0350b6dfeea0620d9a64f94e09dbe57d29be3664/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f7074696d6973746469676974616c2f6e6f76612d73657474696e67732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/optimistdigital/nova-settings)[![Total Downloads](https://camo.githubusercontent.com/f585a87843998a2693614fe9c2c2c5ef1cf6ac85a2ce78343f72517e0881a264/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f7074696d6973746469676974616c2f6e6f76612d73657474696e67732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/optimistdigital/nova-settings)

This [Laravel Nova](https://nova.laravel.com) package allows you to create custom settings in code (using Nova's native fields) and creates a UI for the users where the settings can be edited.

Requirements
------------

[](#requirements)

- `php: >=7.2`
- `laravel/nova: ^3.0`

Features
--------

[](#features)

- Settings fields management in code
- UI for editing settings
- Helpers for accessing settings
- Rule validation support
- Supports [eminiarts/nova-tabs](https://github.com/eminiarts/nova-tabs)
- Supports [nova-translatable](https://github.com/optimistdigital/nova-translatable) w/ rule validation

Screenshots
-----------

[](#screenshots)

[![Settings View](docs/index.png)](docs/index.png)

Installation
------------

[](#installation)

Install the package in a Laravel Nova project via Composer and run migrations:

```
# Install nova-settings
composer require optimistdigital/nova-settings

# Run migrations
php artisan migrate
```

Register the tool with Nova in the `tools()` method of the `NovaServiceProvider`:

```
// in app/Providers/NovaServiceProvider.php

public function tools()
{
    return [
        // ...
        new \OptimistDigital\NovaSettings\NovaSettings
    ];
}
```

Usage
-----

[](#usage)

### Registering fields

[](#registering-fields)

Define the fields in your `NovaServiceProvider`'s `boot()` function by calling `NovaSettings::setSettingsFields()`.

```
// Using an array
\OptimistDigital\NovaSettings\NovaSettings::addSettingsFields([
    Text::make('Some setting', 'some_setting'),
    Number::make('A number', 'a_number'),
]);

// OR

// Using a callable
\OptimistDigital\NovaSettings\NovaSettings::addSettingsFields(function() {
  return [
    Text::make('Some setting', 'some_setting'),
    Number::make('A number', 'a_number'),
  ];
});
```

### Casts

[](#casts)

If you want the value of the setting to be formatted before it's returned, pass an array similar to `Eloquent`'s `$casts` property as the second parameter.

```
\OptimistDigital\NovaSettings\NovaSettings::addSettingsFields([
    // ... fields
], [
  'some_boolean_value' => 'boolean',
  'some_float' => 'float',
  'some_collection' => 'collection',
  // ...
]);
```

### Subpages

[](#subpages)

Add a settings page name as a third argument to list those settings in a custom subpage.

```
\OptimistDigital\NovaSettings\NovaSettings::addSettingsFields([
    Text::make('Some setting', 'some_setting'),
    Number::make('A number', 'a_number'),
], [], 'Subpage');
```

If you leave the custom name empty, the field(s) will be listed under "General".

To translate the page name, publish the translations and add a new key `novaSettings.$subpage` to the respective translations file, where `$subpage` is the name of the page (full lowercase, slugified).

### Authorization

[](#authorization)

#### Show/hide all settings

[](#showhide-all-settings)

If you want to hide the whole `Settings` area from the sidebar, you can authorize the `NovaSettings` tool like so:

```
public function tools(): array
{
    return [
        NovaSettings::make()->canSee(fn () => user()->isAdmin()),
    ];
}
```

#### Show/hide specific setting fields

[](#showhide-specific-setting-fields)

If you want to hide only some settings, you can use `->canSee(fn () => ...)` per field. Like so:

```
Text::make('A text field')
  ->canSee(fn () => user()->isAdmin()),
```

### Helper functions

[](#helper-functions)

#### nova\_get\_settings($keys = null)

[](#nova_get_settingskeys--null)

Call `nova_get_settings()` to get all the settings formated as a regular array. If you pass in `$keys` as an array, it will return only the keys listed.

#### nova\_get\_setting($key, $default = null)

[](#nova_get_settingkey-default--null)

To get a single setting's value, call `nova_get_setting('some_setting_key')`. It will return either a value or null if there's no setting with such key.

You can also pass default value as a second argument `nova_get_setting('some_setting_key', 'default_value')`, which will be returned, if no setting was found with given key.

#### nova\_set\_setting\_value($key, $value = null)

[](#nova_set_setting_valuekey-value--null)

Sets a setting value for the given key.

Configuration
-------------

[](#configuration)

The config file can be published using the following command:

```
php artisan vendor:publish --provider="OptimistDigital\NovaSettings\NovaSettingsServiceProvider" --tag="config"
```

NameTypeDefaultDescription`reload_page_on_save`BooleanfalseReload the entire page on save. Useful when updating any Nova UI related settings.`models.settings`Model`Settings::class`Optionally override the Settings model.The migration can also be published and overwritten using:

```
php artisan vendor:publish --provider="OptimistDigital\NovaSettings\NovaSettingsServiceProvider" --tag="migrations"
```

Localization
------------

[](#localization)

The translation file(s) can be published by using the following command:

```
php artisan vendor:publish --provider="OptimistDigital\NovaSettings\NovaSettingsServiceProvider" --tag="translations"
```

You can add your translations to `resources/lang/vendor/nova-settings/` by creating a new translations file with the locale name (ie `et.json`) and copying the JSON from the existing `en.json`.

Credits
-------

[](#credits)

- [Tarvo Reinpalu](https://github.com/Tarpsvo)

License
-------

[](#license)

Nova Settings is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 85% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~29 days

Recently: every ~132 days

Total

35

Last Release

1460d ago

Major Versions

1.4.0 → 2.0.02020-01-17

2.6.2 → 3.0.02020-12-02

PHP version history (2 changes)1.0.0PHP &gt;=7.1.0

3.0.0PHP &gt;=7.2.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/d06243a1084294de83074cbfb65d1e53ce3ae3bb66f3eab086cd92cdf37a3c62?d=identicon)[crayon](/maintainers/crayon)

---

Top Contributors

[![Tarpsvo](https://avatars.githubusercontent.com/u/2018660?v=4)](https://github.com/Tarpsvo "Tarpsvo (192 commits)")[![allantatter](https://avatars.githubusercontent.com/u/386999?v=4)](https://github.com/allantatter "allantatter (16 commits)")[![MarikaMustV](https://avatars.githubusercontent.com/u/31190256?v=4)](https://github.com/MarikaMustV "MarikaMustV (3 commits)")[![alexrififi](https://avatars.githubusercontent.com/u/21067613?v=4)](https://github.com/alexrififi "alexrififi (3 commits)")[![indykoning](https://avatars.githubusercontent.com/u/15870933?v=4)](https://github.com/indykoning "indykoning (3 commits)")[![mohamedary](https://avatars.githubusercontent.com/u/17085444?v=4)](https://github.com/mohamedary "mohamedary (2 commits)")[![liorocks](https://avatars.githubusercontent.com/u/534610?v=4)](https://github.com/liorocks "liorocks (2 commits)")[![mxm1070](https://avatars.githubusercontent.com/u/11588575?v=4)](https://github.com/mxm1070 "mxm1070 (1 commits)")[![omarhen](https://avatars.githubusercontent.com/u/5448144?v=4)](https://github.com/omarhen "omarhen (1 commits)")[![royduin](https://avatars.githubusercontent.com/u/1703233?v=4)](https://github.com/royduin "royduin (1 commits)")[![bastihilger](https://avatars.githubusercontent.com/u/1419634?v=4)](https://github.com/bastihilger "bastihilger (1 commits)")[![vkazakevich](https://avatars.githubusercontent.com/u/9676524?v=4)](https://github.com/vkazakevich "vkazakevich (1 commits)")

---

Tags

laravelnova

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/crayon-nova-settings/health.svg)

```
[![Health](https://phpackages.com/badges/crayon-nova-settings/health.svg)](https://phpackages.com/packages/crayon-nova-settings)
```

###  Alternatives

[optimistdigital/nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag &amp; drop.

2872.1M6](/packages/optimistdigital-nova-sortable)[outl1ne/nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag &amp; drop.

2861.8M9](/packages/outl1ne-nova-sortable)[optimistdigital/nova-multiselect-field

A multiple select field for Laravel Nova.

3403.5M7](/packages/optimistdigital-nova-multiselect-field)[digital-creative/conditional-container

Provides an easy way to conditionally show and hide fields in your Nova resources.

116593.8k4](/packages/digital-creative-conditional-container)[sbine/route-viewer

A Laravel Nova tool to view your registered routes.

57215.9k](/packages/sbine-route-viewer)[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

14720.0k](/packages/markwalet-nova-modal-response)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
