PHPackages                             tsungsoft/error-message - 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. tsungsoft/error-message

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

tsungsoft/error-message
=======================

A Laravel Nova field.

0.0.3(6y ago)228.4k↓30%1MITPHPPHP &gt;=7.1.0

Since Oct 31Pushed 6y ago1 watchersCompare

[ Source](https://github.com/anditsung/laravel-nova-error-message)[ Packagist](https://packagist.org/packages/tsungsoft/error-message)[ RSS](/packages/tsungsoft-error-message/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)DependenciesVersions (5)Used By (1)

Laravel Nova Error Message on Form
==================================

[](#laravel-nova-error-message-on-form)

When throwing exception will display our actual message but only works on local environment and debug is true. if using this on production environment and debug is false it will always showing Server Error

but on the other hand using ValidationException, it will show "There was a problem submitting the form." and there is no way to show our message to the user ( as far as i know).

using this will ada new field on the form but only showing it when have error message.

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

[](#installation)

using packagist

```
composer require tsungsoft/error-message

```

using github repository add this on composer.json

```
"require": {
    "tsungsoft/error-message": "*"
}
"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/anditsung/laravel-nova-error-message"
    }
],

```

Usage
-----

[](#usage)

on Nova Resource

```
use Tsungsoft\ErrorMessage\ErrorMessage;

...

public function fields(Request $request)
{
    return [
        ...

        ErrorMessage::make('Error'),            // 'Error' -> must have the same value on ValidationException

        ...
    ];
}

...

```

on Model

```
...

private static function validationError($message)
{
    $messageBag = new MessageBag;
    $messageBag->add('error', __($message));    // 'error' -> must have the same value when creating the field on nova resource

    throw ValidationException::withMessages($messageBag->getMessages());
}

protected static function boot()
{
    parent::boot();

    static::creating(function($user) {

        ...

        self::validationError("You have an error");

        ...

    });

    static::updating(function($user) {

        ...

        self::validationError("You have an error");

        ...

    });
}

...

```

[![Create User](https://github.com/anditsung/laravel-nova-error-message/raw/master/img/create%20user.png)](https://github.com/anditsung/laravel-nova-error-message/blob/master/img/create%20user.png)

[![Update User](https://github.com/anditsung/laravel-nova-error-message/raw/master/img/update%20user.png)](https://github.com/anditsung/laravel-nova-error-message/blob/master/img/update%20user.png)

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

3

Last Release

2392d ago

### Community

Maintainers

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

---

Top Contributors

[![anditsung](https://avatars.githubusercontent.com/u/1090413?v=4)](https://github.com/anditsung "anditsung (10 commits)")

---

Tags

laravelnova

### Embed Badge

![Health badge](/badges/tsungsoft-error-message/health.svg)

```
[![Health](https://phpackages.com/badges/tsungsoft-error-message/health.svg)](https://phpackages.com/packages/tsungsoft-error-message)
```

###  Alternatives

[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)[genealabs/laravel-overridable-model

Provide a uniform method of allowing models to be overridden in Laravel.

92398.0k2](/packages/genealabs-laravel-overridable-model)[inspheric/nova-defaultable

Default values for Nova fields when creating resources and running resource actions.

51174.8k1](/packages/inspheric-nova-defaultable)[murdercode/nova4-tinymce-editor

Boost your Laravel Nova with the TinyMCE editor.

17165.2k](/packages/murdercode-nova4-tinymce-editor)[yieldstudio/nova-google-autocomplete

A Laravel Nova Google autocomplete field.

12218.4k](/packages/yieldstudio-nova-google-autocomplete)

PHPackages © 2026

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