PHP code example of coercive / orator

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

    

coercive / orator example snippets


$slack = new SlackHook(HOOKS_SLACK_URL);
$slack->publish('Hello!');

$discord = new DiscordHook(HOOKS_DISCORD_URL);
$discord->setContent('Hello!');
$discord->publish();

$discord->setTts(true);

# Simple content
$embed1 = new Embed('Light', 'This is white colored', '#FFFFFF');

# Complex content
$embed2 = new Embed;
$embed2->Author()->setName('JOHN DOE');
$embed2->setTitle('Custom title');
$embed2->setColor('#FF0000');
$embed2->setDescription('Say something');
$embed2->Footer()->setText('This is the end');

$discord = new DiscordHook(HOOKS_DISCORD_URL);
$discord->setContent('Hello!');
$discord->addEmbed($embed1);
$discord->addEmbed($embed2);
$discord->publish();

L::detectLogpath();
L::basepath('/root/path/to/my/project');
L::header('prod', 'myproject', 'coercive', '•••');
L::colorizeLevel();


# Log by level (debug, error, fatal, info, warning)
L::info('Hello! This is an info log!');
L::warning('Hello! This is a warning log!');

# Log mixed data
L::debug([
    'example',
    'data',
    'to',
    'log'
]);

# Add separator
L::separator();
L::rainbow();