This is Api Message for use in all projects.
You can add this library as a local, per-project dependency to your project using Composer:
$ composer require dom-pixel/api-message
<?php
namespace App\Api;
class ApiMessage
{
public static function message($isSuccess, $code, $message = null, $payload = null)
{
return [
'isSuccess' => $isSuccess,
'message' => $message,
'payload' => $payload,
'code' => $code
];
}
}