PHPackages                             victormgomes/rest-messages - 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. [API Development](/categories/api)
4. /
5. victormgomes/rest-messages

ActiveLibrary[API Development](/categories/api)

victormgomes/rest-messages
==========================

Standardized message responses for REST resources

1.0.0(2mo ago)1127↓44.4%[2 PRs](https://github.com/VictorMGomes/rest-messages/pulls)MITPHPPHP ^8.4CI passing

Since Apr 26Pushed 1mo agoCompare

[ Source](https://github.com/VictorMGomes/rest-messages)[ Packagist](https://packagist.org/packages/victormgomes/rest-messages)[ Docs](https://github.com/victormgomes/rest-messages)[ GitHub Sponsors](https://github.com/sponsors/VictorMGomes)[ RSS](/packages/victormgomes-rest-messages/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (4)Dependencies (20)Versions (7)Used By (0)

REST Messages
=============

[](#rest-messages)

[![Latest Version on Packagist](https://camo.githubusercontent.com/8205295f9ba6419c80afed37e6b20db12dcc8fdbf5d7da8dc53afbf5403700f4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f766963746f726d676f6d65732f726573742d6d657373616765732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/victormgomes/rest-messages)[![GitHub Tests Action Status](https://camo.githubusercontent.com/79caf9d0aa41d408e31a228b1d0ba1051dad2fa26aae55c4855cd79f9910ac6d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f766963746f726d676f6d65732f726573742d6d657373616765732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/victormgomes/rest-messages/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/9cf98dacb83bb66d8b87dc169911d00808a25e03ca2a5d370b5fc394ecc66841/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f766963746f726d676f6d65732f726573742d6d657373616765732f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/victormgomes/rest-messages/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/9ad52156d1048353039ac9015a9ecf91fbe3c97d9dc95d3b9d527a07ce1dd38d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f766963746f726d676f6d65732f726573742d6d657373616765732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/victormgomes/rest-messages)[![License](https://camo.githubusercontent.com/6e6791706e0ab1e93ef10b025b4202d68508c2ab981f8d8e885f902e3dd90265/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f766963746f726d676f6d65732f726573742d6d657373616765732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/victormgomes/rest-messages)

**Standardized message responses for REST resources**

---

Introduction
------------

[](#introduction)

**Rest Messages** is a lightweight package designed to standardize success messages across your Laravel REST API. It automatically detects the model name and the current CRUD action (index, store, update, destroy) to generate localized and professional response messages.

### Why use this package?

[](#why-use-this-package)

- **Consistency**: Ensure every success response in your API follows the same linguistic pattern.
- **Automatic Detection**: No need to manually type messages for every controller action. The package "just knows" what you're doing.
- **Localized**: Built-in support for multiple languages with proper grammar and gender resolution for model names.
- **Clean API**: Focus on your data, while the package handles the communication part of your REST interface.

---

Support us
----------

[](#support-us)

We invest a lot of resources into creating [best in class open source packages](https://github.com/victormgomes). You can support us by [sponsoring us on GitHub](https://github.com/sponsors/VictorMGomes).

---

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

[](#installation)

You can install the package via composer:

```
composer require victormgomes/rest-messages
```

---

Usage
-----

[](#usage)

Simply use the `HasResourceMessages` trait in your response helpers or base controllers.

```
use Victormgomes\RestMessages\Traits\HasResourceMessages;

class ApiResponse
{
    use HasResourceMessages;

    public function success($data)
    {
        return response()->json([
            'message' => $this->message(),
            'data' => $data,
        ]);
    }
}
```

The `$this->message()` method will automatically resolve the model and action from the current route context. For example, if called from `UserController@store`, it will return: *"User created successfully."*

---

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Victor M. Gomes](https://github.com/VictorMGomes)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance91

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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 ~10 days

Total

4

Last Release

60d ago

Major Versions

0.0.3 → 1.0.02026-05-26

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20375480?v=4)[Victor M. Gomes](/maintainers/victormgomes)[@VictorMGomes](https://github.com/VictorMGomes)

---

Top Contributors

[![victormgomes](https://avatars.githubusercontent.com/u/20375480?v=4)](https://github.com/victormgomes "victormgomes (9 commits)")[![VictorMGomes](https://avatars.githubusercontent.com/u/20375480?v=4)](https://github.com/VictorMGomes "VictorMGomes (9 commits)")

---

Tags

laravelVictor M. Gomesrest-messages

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/victormgomes-rest-messages/health.svg)

```
[![Health](https://phpackages.com/badges/victormgomes-rest-messages/health.svg)](https://phpackages.com/packages/victormgomes-rest-messages)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M347](/packages/psalm-plugin-laravel)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k30.2M151](/packages/laravel-cashier)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77922.3M186](/packages/laravel-mcp)[api-platform/laravel

API Platform support for Laravel

58174.6k17](/packages/api-platform-laravel)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M136](/packages/laravel-pulse)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M133](/packages/roots-acorn)

PHPackages © 2026

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