PHP code example of bpartner / messages

1. Go to this page and download the library: Download bpartner/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/ */

    

bpartner / messages example snippets


   $result = Messages::make();
   
   or
   
   $result = Messages::make('Default success message'); 
   
   or use facade ApiMessage
     
   $result = ApiMessage::setMessage('My message')
            ->setMeta($data)
            ->root('version', '1.0')
            ->get();

    $model = new Model();
    .....
    $result->setMeta($model);

    $result->setErrorMessage('Error message');

    $result->get();

    return $result->result();