PHPackages                             norman-huth/nova-single-resource - 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. [Admin Panels](/categories/admin)
4. /
5. norman-huth/nova-single-resource

ActiveLibrary[Admin Panels](/categories/admin)

norman-huth/nova-single-resource
================================

Laravel Nova resource and fields for single record resources

0.0.5(3y ago)512.8k↓65.9%1[1 issues](https://github.com/Muetze42/nova-single-resource/issues)MITPHPPHP ^8.0

Since Apr 29Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Muetze42/nova-single-resource)[ Packagist](https://packagist.org/packages/norman-huth/nova-single-resource)[ Docs](https://github.com/Muetze42/nova-single-resource)[ RSS](/packages/norman-huth-nova-single-resource/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (5)DependenciesVersions (7)Used By (0)

Laravel Nova Single Resource
============================

[](#laravel-nova-single-resource)

Create resources for "single" resources (key-value database structure), such as a settings table.

[![index](https://raw.githubusercontent.com/Muetze42/asset-repo/main/nova-single-resource/images/index.png)](https://raw.githubusercontent.com/Muetze42/asset-repo/main/nova-single-resource/images/index.png)[![detail](https://raw.githubusercontent.com/Muetze42/asset-repo/main/nova-single-resource/images/detail.png)](https://raw.githubusercontent.com/Muetze42/asset-repo/main/nova-single-resource/images/detail.png)

Install
-------

[](#install)

`composer require norman-huth/nova-single-resource`

Usage
-----

[](#usage)

The following description refers to the Model Settings as an example....

You can create a resource with `php artisan nova:single-resource Setting`.
The table still requires a primary ID and this package is designed to allow the Value column to be nullable.

```
use NormanHuth\SingleResource\Traits\ResourceTrait;

class Setting extends Resource
{
    use ResourceTrait;  // required

    public function __construct($resource = null)
    {
        $this->bootResourceTrait(); // Required
        parent::__construct($resource);
    }

    protected static function sections(): array
    {
        return [
            'general-settings' =>
            [
                'name'   => __('General Settings'),
                'icon'   => 'eye',
            ],
            'system' =>
            [
                'name'   => __('System'),
                'faIcon' => 'fa-brands fa-laravel fa-fw',
            ],
        ];
    }

    /**
     * The model the resource corresponds to.
     *
     * @var string
     */
    public static string $model = \App\Models\Setting::class;

    public function getGeneralSettingsFields(NovaRequest $request): array
    {
        return [
            Currency::make('Price')->currency('EUR'),
            Text::make(__('Text'), 'text'),
            Boolean::make(__('Boolean'), 'boolean'),
        ];
    }

    public function getSystemFields(NovaRequest $request): array
    {
        return [
            Date::make(__('Date'), 'Date'),
            DateTime::make(__('DateTime'), 'DateTime'),
        ];
    }
}
```

#### Define the sections in `sections()`

[](#define-the-sections-in-sections)

```
'general-settings' => // Required: unique slug
[
    'name'   => 'My Settings' // Required: Display section name
    'icon'   => 'eye', // Optional: Heroicon icon https://heroicons.com/
    'faIcon' => 'fa-brands fa-laravel fa-fw', // Optional: FontAwesome Icon (not included!) https://fontawesome.com/
],
```

And add for every section fields.
Format: `get'.Str::studly($slug).'Fields`: `getGeneralSettingsFields(NovaRequest $request)`

### Columns

[](#columns)

By default, the columns key and value are used in the database.

If you want to use others. You must specify them in the model:

```
class Setting extends Model
{
    public static string $keyColumn = 'key';
    public static string $valueColumn = 'value';
```

### Change cast of a field

[](#change-cast-of-a-field)

```
Text::make(__('SMTP Password'), 'smtp_password')
    ->cast('encrypted'),
```

### Single Resource Fields

[](#single-resource-fields)

In this resource must be used adjusted fields.

The following fields are already included:

#### Nova

[](#nova)

OriginalSingle Resource[Boolean](https://nova.laravel.com/docs/4.0/resources/fields.html#boolean-field)NormanHuth\\SingleResource\\Fields\\Boolean[BooleanGroup](https://nova.laravel.com/docs/4.0/resources/fields.html#booleangroup-field)NormanHuth\\SingleResource\\Fields\\BooleanGroup[Color](https://nova.laravel.com/docs/4.0/resources/fields.html#color-field)NormanHuth\\SingleResource\\Fields\\Color[Country](https://nova.laravel.com/docs/4.0/resources/fields.html#country-field)NormanHuth\\SingleResource\\Fields\\Country[Currency](https://nova.laravel.com/docs/4.0/resources/fields.html#currency-field)NormanHuth\\SingleResource\\Fields\\Currency[Date](https://nova.laravel.com/docs/4.0/resources/fields.html#date-field)NormanHuth\\SingleResource\\Fields\\Date[DateTime](https://nova.laravel.com/docs/4.0/resources/fields.html#datetime-field)NormanHuth\\SingleResource\\Fields\\DateTime[KeyValue](https://nova.laravel.com/docs/4.0/resources/fields.html#keyvalue-field)NormanHuth\\SingleResource\\Fields\\KeyValue[Markdown](https://nova.laravel.com/docs/4.0/resources/fields.html#markdown-field)NormanHuth\\SingleResource\\Fields\\Markdown[MultiSelect](https://nova.laravel.com/docs/4.0/resources/fields.html#multiselect-field)NormanHuth\\SingleResource\\Fields\\MultiSelect[Number](https://nova.laravel.com/docs/4.0/resources/fields.html#number-field)NormanHuth\\SingleResource\\Fields\\Number[Select](https://nova.laravel.com/docs/4.0/resources/fields.html#select-field)NormanHuth\\SingleResource\\Fields\\Select[Text](https://nova.laravel.com/docs/4.0/resources/fields.html#text-field)NormanHuth\\SingleResource\\Fields\\Text[Textarea](https://nova.laravel.com/docs/4.0/resources/fields.html#textarea-field)NormanHuth\\SingleResource\\Fields\\Textarea[Timezone](https://nova.laravel.com/docs/4.0/resources/fields.html#timezone-field)NormanHuth\\SingleResource\\Fields\\Timezone[Trix](https://nova.laravel.com/docs/4.0/resources/fields.html#trix-field)NormanHuth\\SingleResource\\Fields\\Trix#### File Fields

[](#file-fields)

OriginalSingle Resource[File](https://nova.laravel.com/docs/4.0/resources/fields.html#boolean-field)NormanHuth\\SingleResource\\Fields\\File[Image](https://nova.laravel.com/docs/4.0/resources/file-fields.html#images)NormanHuth\\SingleResource\\Fields\\Image[Avatar](https://nova.laravel.com/docs/4.0/resources/file-fields.html#avatars)NormanHuth\\SingleResource\\Fields\\Avatar#### Package Fields (alphabetic)

[](#package-fields-alphabetic)

PackageSingle Resource[flatroy/nova-progressbar-field](https://github.com/Flatroy/nova-progressbar-field)NormanHuth\\SingleResource\\Fields\\Flatroy\\FieldProgressbar[murdercode/seo-title](https://github.com/murdercode/Nova4-SeoTitle)NormanHuth\\SingleResource\\Fields\\Murdercode\\SeoTitle[murdercode/nova4-seo-description](https://github.com/murdercode/Nova4-SeoTitle)NormanHuth\\SingleResource\\Fields\\Murdercode\\SeoDescription[murdercode/nova4-tinymce-editor](https://github.com/murdercode/Nova4-TinymceEditor)NormanHuth\\SingleResource\\Fields\\Murdercode\\TinymceEditor[norman-huth/nova-bbcode-textarea](https://github.com/Muetze42/nova-bbcode-textarea)NormanHuth\\SingleResource\\Fields\\NormanHuth\\BBCode
NormanHuth\\SingleResource\\Fields\\NormanHuth\\BB[norman-huth/nova-iframe-popup](https://github.com/Muetze42/norman-huth/nova-iframe-popup)NormanHuth\\SingleResource\\Fields\\NormanHuth\\IframePopup[norman-huth/nova-secret-field](https://github.com/Muetze42/norman-huth/nova-secret-field)NormanHuth\\SingleResource\\Fields\\NormanHuth\\SecretField[norman-huth/nova-values-field](https://github.com/Muetze42/nova-values-field)NormanHuth\\SingleResource\\Fields\\NormanHuth\\Values### Field Development Notices

[](#field-development-notices)

- Try this [trait](src/Traits/FieldTrait.php)
- Cast with `protected string $cast`. Example [here](src/Fields/Boolean.php). See `protected function castValue` in the trait

Todos
-----

[](#todos)

- Custom `ResourceUpdateController` &amp; `Update` component to be able to use slugs in url
- [ebess/advanced-nova-media-library](https://github.com/ebess/advanced-nova-media-library)
- ???

---

[![More Laravel Nova Packages](https://raw.githubusercontent.com/Muetze42/asset-repo/main/svg/more-laravel-nova-packages.svg)](https://huth.it/nova-packages)

[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://vshymanskyy.github.io/StandWithUkraine/)

[![Woman. Life. Freedom.](https://raw.githubusercontent.com/Muetze42/Muetze42/2033b219c6cce0cb656c34da5246434c27919bcd/files/iran-banner-big.svg)](https://linktr.ee/CurrentPetitionsFreeIran)

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.4% 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 ~56 days

Total

5

Last Release

1303d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2579233?v=4)[Muetze](/maintainers/Muetze)[@muetze](https://github.com/muetze)

---

Top Contributors

[![Muetze42](https://avatars.githubusercontent.com/u/26193232?v=4)](https://github.com/Muetze42 "Muetze42 (27 commits)")[![Kiv4h](https://avatars.githubusercontent.com/u/1305053?v=4)](https://github.com/Kiv4h "Kiv4h (1 commits)")

---

Tags

laravellaravel-novanova-4laravelnovalaravel-novanova-4

### Embed Badge

![Health badge](/badges/norman-huth-nova-single-resource/health.svg)

```
[![Health](https://phpackages.com/badges/norman-huth-nova-single-resource/health.svg)](https://phpackages.com/packages/norman-huth-nova-single-resource)
```

###  Alternatives

[david-griffiths/nova-dark-theme

A dark theme for Laravel Nova

71600.0k](/packages/david-griffiths-nova-dark-theme)[pdmfc/nova-action-button

A Laravel Nova field to run actions.

37753.3k1](/packages/pdmfc-nova-action-button)[khalin/nova-link-field

A Laravel Nova Link field.

31587.5k2](/packages/khalin-nova-link-field)[cloudcake/nova-fixed-bars

A Laravel Nova package to add a responsive and/or fixed sidebar and navigation bar to the Nova admin UI.

33215.1k2](/packages/cloudcake-nova-fixed-bars)[stephenlake/nova-fixed-bars

A Laravel Nova package to add a responsive and/or fixed sidebar and navigation bar to the Nova admin UI.

3377.9k](/packages/stephenlake-nova-fixed-bars)

PHPackages © 2026

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