PHP code example of victormgomes / rest-messages
1. Go to this page and download the library: Download victormgomes/rest-messages library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
victormgomes / rest-messages example snippets
use Victormgomes\RestMessages\Traits\HasResourceMessages;
class ApiResponse
{
use HasResourceMessages;
public function success($data)
{
return response()->json([
'message' => $this->message(),
'data' => $data,
]);
}
}