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(2w ago)2122↓16.7%[1 PRs](https://github.com/VictorMGomes/rest-messages/pulls)MITPHPPHP ^8.4CI passing

Since Apr 26Pushed 2w 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 1w ago

READMEChangelog (4)Dependencies (20)Versions (6)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

47

—

FairBetter than 93% of packages

Maintenance97

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

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 ~10 days

Total

4

Last Release

15d 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)")

---

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

3325.1M337](/packages/psalm-plugin-laravel)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k51.0M7.4k](/packages/larastan-larastan)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

76318.2M110](/packages/laravel-mcp)[spatie/laravel-health

Monitor the health of a Laravel application

88011.3M149](/packages/spatie-laravel-health)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

815320.5k3](/packages/defstudio-telegraph)[simplestats-io/laravel-client

Analytics for Laravel. Track visitors, registrations, and payments. Discover which channels actually drive revenue, not just traffic. Server-side, GDPR compliant, ad-blocker proof.

5019.3k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

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