PHP code example of vntrungld / laravel-ticktock

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

    

vntrungld / laravel-ticktock example snippets


'providers' => [
    Vntrungld\LaravelTicktock\TickTockServiceProvider::class,
],

'aliases' => [
    'Ticktock' => Vntrungld\LaravelTicktock\Facades\TickTock::class,
],

class OrderController
{
    public function store()
    {
        tts('checkout');
        $this->validateCart(); tt('validate');
        $this->charge();       tt('charge');
        tte();
    }
}

Ticktock::start('checkout');
$this->validateCart(); Ticktock::capture('validate');
$this->charge();       Ticktock::capture('charge');
Ticktock::end();

ttd();  // dump
ttdd(); // dd
ttl();  // log
ttr();  // string

Ticktock::dump();
Ticktock::dd();
Ticktock::log();
Ticktock::render();

$users = Ticktock::measure('load users', function () {
    return User::with('roles')->get();
});
bash
php artisan vendor:publish --tag=ticktock-config