1. Go to this page and download the library: Download maxi-format/maxi 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/ */
use Maxi\Maxi;
use Maxi\Attribute\MaxiType;
use Maxi\Attribute\MaxiField;
#[MaxiType(alias: 'U', name: 'User')]
class User
{
#[MaxiField(typeExpr: 'int', id: true)]
public int $id;
#[MaxiField( 'Julie'
echo $user->email; // '[email protected]'
use Maxi\Attribute\MaxiType;
use Maxi\Attribute\MaxiField;
#[MaxiType(alias: 'O', name: 'Order')]
class Order
{
#[MaxiField(typeExpr: 'int', id: true)]
public int $id;
#[MaxiField(typeExpr: 'U')]
public int|User $user;
#[MaxiField(typeExpr: 'decimal')]
public string $total;
}