PHP code example of taecontrol / larvis

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

    

taecontrol / larvis example snippets


MOONGUARD_DOMAIN=https://mymoonguard.com
MOONGUARD_SITE_API_TOKEN=LDUxazsuq6aYi9bvSMqc6vkMXOjsD7JdrIN2FkWtA4UVNhaPE02gMS23FIp0
KRATER_DEBUG=false

larvis(["hello","i'm Larvis"]);

larvis("Hello");

larvis([1, 2, 3, 4, 5]);

larvis(null);

$collection = collect([1, 2, 3, 4, 5]);
larvis($collection);

$user = new User();
$user->name = 'John Doe';
$user->email = '[email protected]';
$user->age = 30;
larvis($user);

[
    'watchers' => [
        'queries' => [
            'enabled' => true,
        ],
    ],
];

larvis()->startQueryWatch();
User::all();
larvis()->stopQueryWatch();

[
    'watchers' => [
        'exceptions' => [
            'enabled' => true,
        ],
    ],
];

[
    'watchers' => [
        'request' => [
            'enabled' => true,
        ],
    ],
];

[
    'readers' => [
        'model' => [
            'props' => [
                'connection',
                'table',
                'primaryKey',
                'keyType',
                'incrementing',
                'with',
                'withCount',
                //...
            ],
        ],
    ],
];

[
    'collection' => [
        'props' => [
            'items',
            'escapeWhenCastingToString',
        ],
    ],
];



protected function schedule(Schedule $schedule): void
{
    $schedule->command(CheckHardwareHealthCommand::class)
        ->everyFiveMinutes();
}
bash
php artisan vendor:publish --tag larvis-config