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

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

akill/message
=============

This message for output json or html

1181PHP

Since Sep 28Pushed 5y ago1 watchersCompare

[ Source](https://github.com/akilsagitarius/message)[ Packagist](https://packagist.org/packages/akill/message)[ RSS](/packages/akill-message/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Message JSON Response And HTML Response (Commingsoon) Laravel 5
===============================================================

[](#message-json-response-and-html-response-commingsoon-laravel-5)

[![FOSSA Status](https://camo.githubusercontent.com/02281e816ce00a493d88678a5be0cfa9af892716d1f5f998cbd00909619967b1/68747470733a2f2f6170702e666f7373612e636f6d2f6170692f70726f6a656374732f6769742532426769746875622e636f6d253246616b696c736167697461726975732532466d6573736167652e7376673f747970653d736869656c64)](https://app.fossa.com/projects/git%2Bgithub.com%2Fakilsagitarius%2Fmessage?ref=badge_shield)

A minimal package for JSON Response API and HTML Response (Commingsoon) to clients, Laravel.

Getting Started
---------------

[](#getting-started)

### Install the package via composer.

[](#install-the-package-via-composer)

Download package dengan composer

```
composer require akilsagitarius/message
```

or

```
{
	"require": {
		"akilsagitarius/message" : "dev-master"
	}
}

```

### Register the service provider.

[](#register-the-service-provider)

This package makes use of Laravel's auto-discovery of service providers. If you are an using earlier version of Laravel (&lt; 5.4) you will need to manually register the service provider.

Add `akilsagitarius\message\MessageServiceProvider::class` to the `providers` array in `config/app.php`.

example

```
'providers' => [
	....

	akilsagitarius\message\MessageServiceProvider::class,
]
```

### Register the service provider.

[](#register-the-service-provider-1)

Now, publish the configuration code response to your provider

```
php artisan vendor:publish --tag=public --force
```

Usage
=====

[](#usage)

Basic
-----

[](#basic)

**NOTE:** The response code returned in the body payload will be set as the actual HTTP header response code as well.

### Regular Responses

[](#regular-responses)

This is simple response

```
Route::get('/message', function () {
    $reuslt = Message::success(200)->get();
    return $reuslt;
});
```

Will result in the following structured result:

```
{
    code: 200,
    result: "Success",
    message: "OK"
}
```

### Secondary Responses

[](#secondary-responses)

This is response with result your send

```
Route::get('/mess', function () {
    $array = array(
        'first' => 'This is first data',
        'second' => 'This is second data',
    );
    $reuslt = Message::success(200)->payload($array)->get();
    return $reuslt;
});
```

Will result in the following structured result:

```
{
    code: 200,
    result: "Informational",
    message: "OK",
    payload: {
        first: "This is first data",
        second: "This is second data"
    }
}
```

Authors
-------

[](#authors)

\***Muhammad Akil** - *Initial work* - [Akill](https://akilsagitarius.github.io/)

License
-------

[](#license)

[![FOSSA Status](https://camo.githubusercontent.com/387a8fbcc440b729d974b995bdf98f7c0bfcdc3f11a240989452f9e44c4e824e/68747470733a2f2f6170702e666f7373612e636f6d2f6170692f70726f6a656374732f6769742532426769746875622e636f6d253246616b696c736167697461726975732532466d6573736167652e7376673f747970653d6c61726765)](https://app.fossa.com/projects/git%2Bgithub.com%2Fakilsagitarius%2Fmessage?ref=badge_large)

[![FOSSA Status](https://camo.githubusercontent.com/387a8fbcc440b729d974b995bdf98f7c0bfcdc3f11a240989452f9e44c4e824e/68747470733a2f2f6170702e666f7373612e636f6d2f6170692f70726f6a656374732f6769742532426769746875622e636f6d253246616b696c736167697461726975732532466d6573736167652e7376673f747970653d6c61726765)](https://app.fossa.com/projects/git%2Bgithub.com%2Fakilsagitarius%2Fmessage?ref=badge_large)

Acknowledgments
---------------

[](#acknowledgments)

- Hat tip to anyone whose code was used
- Inspiration
- etc

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 92.3% 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/16ab78227adf56065b2fc549a99f10062691725ded6b801f6fc8d483263af01f?d=identicon)[akilsagitarius](/maintainers/akilsagitarius)

---

Top Contributors

[![ak4bento](https://avatars.githubusercontent.com/u/17612342?v=4)](https://github.com/ak4bento "ak4bento (12 commits)")[![fossabot](https://avatars.githubusercontent.com/u/29791463?v=4)](https://github.com/fossabot "fossabot (1 commits)")

---

Tags

laravellumenmessagephpsimple-message

### Embed Badge

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

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

PHPackages © 2026

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