PHP code example of richardtmiles / carbonphp

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

    

richardtmiles / carbonphp example snippets




$id = Users::Post([
        Users::USER_TYPE => 'Athlete',
        Users::USER_IP => '127.0.0.1',
        Users::USER_SPORT => 'GOLF',
        Users::USER_EMAIL_CONFIRMED => 1,
        Users::USER_USERNAME => Config::ADMIN_USERNAME,
        Users::USER_PASSWORD => Config::ADMIN_PASSWORD,
        Users::USER_EMAIL => '[email protected]',
        Users::USER_FIRST_NAME => 'Richard',
        Users::USER_LAST_NAME => 'Miles',
        Users::USER_GENDER => 'Male'
    ]);

Users::Get($user, $uid, [
    Users::SELECT => [
        Users::USER_USERNAME,
        Carbon_Locations::STATE
    ],
    Users::JOIN => [
        Users::INNER => [
            Carbon_Location_References::TABLE_NAME => [
                Users::USER_ID => Carbon_Location_References::ENTITY_REFERENCE
            ],
            Carbon_Locations::TABLE_NAME => [
                Carbon_Locations::ENTITY_ID => Carbon_Location_References::LOCATION_REFERENCE
            ]
        ]
    ],
    Users::PAGINATION => [
        Users::LIMIT => 1,
        Users::ORDER => [Users::USER_USERNAME => Users::ASC]
    ]
]);