PHP code example of maantje / xhprof-buggregator-laravel

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

    

maantje / xhprof-buggregator-laravel example snippets



use SpiralPackages\Profiler\Profiler;

class RegisterUserActionJob 
{
    public function __construct(
        public string $name,
        public string $password
    ) {
    }
    
    /**
     * Get Profiler object from Container DI
     * 
     * @param Profiler $profiler
     * @return void
     */
    public function handle(Profiler $profiler): void
    {
        try {
            $profiler->start();
            
            // code for register new user
        }
        finally {
            $profiler->end();
        }
    }
}