PHPackages                             cznec/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. cznec/nova-settings

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

cznec/nova-settings
===================

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

075↓100%PHP

Since Feb 11Pushed 1y agoCompare

[ Source](https://github.com/cznec/nova-settings)[ Packagist](https://packagist.org/packages/cznec/nova-settings)[ RSS](/packages/cznec-nova-settings/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

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

[](#nova-settings)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5b34fea2bddfe5ebfe056df508f16a53cb7f969b8355c26f0c36da832eb15029/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f75746c316e652f6e6f76612d73657474696e67732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/outl1ne/nova-settings)[![Total Downloads](https://camo.githubusercontent.com/86a11688ca761b12e833f1de8fc0787088306df4101c3cdf86fa3707b4de24be/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f75746c316e652f6e6f76612d73657474696e67732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/outl1ne/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: >=8.0`
- `laravel/nova: ^4.26`

Features
--------

[](#features)

- Settings fields management in code
- UI for editing settings
- Helpers for accessing settings
- Rule validation support

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 outl1ne/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 \Outl1ne\NovaSettings\NovaSettings
    ];
}
```

Usage
-----

[](#usage)

### Registering fields

[](#registering-fields)

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

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

// OR

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

#### Registering field panels

[](#registering-field-panels)

```
// Using an array
\Outl1ne\NovaSettings\NovaSettings::addSettingsFields([
    Panel::make('Panel Title', [
      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.

```
\Outl1ne\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.

```
\Outl1ne\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, $defaults = \[\])

[](#nova_get_settingskeys--null-defaults--)

Call `nova_get_settings()` to get all the settings formated as a regular array. Additionally, you can pass a `key => value` array as a second argument: `nova_get_settings(['some_key], ['some_key' => 'default_value'])`.

#### 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="Outl1ne\NovaSettings\NovaSettingsServiceProvider" --tag="config"
```

NameTypeDefaultDescription`base_path`String`nova-settings`URL path of settings page.`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.`cache`String`:memory:`Cache store name to use that cache, ":memory:" for singleton class, or null to turn off caching.The migration can also be published and overwritten using:

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

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

[](#localization)

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

```
php artisan vendor:publish --provider="Outl1ne\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

19

↑

LowBetter than 12% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity15

Early-stage or recently created project

 Bus Factor1

Top contributor holds 80.8% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/50eb87772391dcd28ef3251661e7656d9963691c8997dce739f6b9f5b9f79255?d=identicon)[cznec](/maintainers/cznec)

---

Top Contributors

[![Tarpsvo](https://avatars.githubusercontent.com/u/2018660?v=4)](https://github.com/Tarpsvo "Tarpsvo (328 commits)")[![allantatter](https://avatars.githubusercontent.com/u/386999?v=4)](https://github.com/allantatter "allantatter (16 commits)")[![marttinnotta](https://avatars.githubusercontent.com/u/7058209?v=4)](https://github.com/marttinnotta "marttinnotta (11 commits)")[![trippo](https://avatars.githubusercontent.com/u/497169?v=4)](https://github.com/trippo "trippo (6 commits)")[![alexrififi](https://avatars.githubusercontent.com/u/21067613?v=4)](https://github.com/alexrififi "alexrififi (4 commits)")[![manuel-watchenterprise](https://avatars.githubusercontent.com/u/135170518?v=4)](https://github.com/manuel-watchenterprise "manuel-watchenterprise (4 commits)")[![MarikaMustV](https://avatars.githubusercontent.com/u/31190256?v=4)](https://github.com/MarikaMustV "MarikaMustV (3 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![indykoning](https://avatars.githubusercontent.com/u/15870933?v=4)](https://github.com/indykoning "indykoning (3 commits)")[![JoshMoreno](https://avatars.githubusercontent.com/u/22627952?v=4)](https://github.com/JoshMoreno "JoshMoreno (2 commits)")[![AndreasFurster](https://avatars.githubusercontent.com/u/7996369?v=4)](https://github.com/AndreasFurster "AndreasFurster (2 commits)")[![Gertiozuni](https://avatars.githubusercontent.com/u/26062255?v=4)](https://github.com/Gertiozuni "Gertiozuni (2 commits)")[![KasparRosin](https://avatars.githubusercontent.com/u/33309407?v=4)](https://github.com/KasparRosin "KasparRosin (2 commits)")[![liorocks](https://avatars.githubusercontent.com/u/534610?v=4)](https://github.com/liorocks "liorocks (2 commits)")[![puzzledmonkey](https://avatars.githubusercontent.com/u/3913622?v=4)](https://github.com/puzzledmonkey "puzzledmonkey (2 commits)")[![dimitri-koenig](https://avatars.githubusercontent.com/u/4375825?v=4)](https://github.com/dimitri-koenig "dimitri-koenig (2 commits)")[![wamesro](https://avatars.githubusercontent.com/u/5340873?v=4)](https://github.com/wamesro "wamesro (1 commits)")[![bastihilger](https://avatars.githubusercontent.com/u/1419634?v=4)](https://github.com/bastihilger "bastihilger (1 commits)")[![crynobone](https://avatars.githubusercontent.com/u/172966?v=4)](https://github.com/crynobone "crynobone (1 commits)")[![ianrobertsFF](https://avatars.githubusercontent.com/u/91917328?v=4)](https://github.com/ianrobertsFF "ianrobertsFF (1 commits)")

### Embed Badge

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

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

###  Alternatives

[jbzoo/composer-graph

Render composer.json + composer.lock dependencies graph

66741.1k2](/packages/jbzoo-composer-graph)[elegantly/laravel-referrer

Remember User Origin

122.7k](/packages/elegantly-laravel-referrer)

PHPackages © 2026

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