PHP code example of inlayphp / support

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

    

inlayphp / support example snippets


use Inlay\Support\Condition;

Condition::make('account_type', 'company');
Condition::make('role', 'guest', 'not-equals');
Condition::make('country', ['HK', 'SG'], 'in');
Condition::truthy('enabled');
Condition::falsy('archived');
Condition::filled('email');
Condition::blank('company_name');

Condition::all(
    Condition::make('account_type', 'company'),
    Condition::any(
        Condition::truthy('verified'),
        Condition::filled('tax_id'),
    ),
    Condition::not(Condition::truthy('suspended')),
);

use Inlay\Support\SafeUrl;

$url = SafeUrl::from('/admin/users/1');
$url->value();
(string) $url;
json_encode($url);