1. Go to this page and download the library: Download adobrovolsky97/illuminar 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/ */
adobrovolsky97 / illuminar example snippets
illuminar()->dump($user, $anotherUser)->tag('users')->red(); // This will add a dump with a red border and a "users" tag
illuminar()->dump('Hello World');
illuminar()->dump(['foo' => 'bar'])->tag('array')->orange();
illuminar()
->dump(function () {
return 'Hello World';
})
->tag('closure')
->green();
illuminar()->dump('Some data')->die(); // This one will terminate the script execution
illuminar()->trackQueries(); // Enables DB queries tracking
User::all(); // This query will be tracked
illuminar()->stopTrackingQueries(); // Disables DB queries tracking
User::all(); // This query will not be tracked
illuminar()->trackSlowQueries(); // Enables slow queries tracking
User::all(); // This query will be tracked only if its execution time is more than x ms (execution time taken from the config)
illuminar()->stopTrackingSlowQueries(); // Disables slow queries tracking
User::query()
->where('name', 'John Doe')
->illuminar() // Allows to dump query while building it
->where('is_active', true)
->illuminar() // Will contain additional where clause
->get();
illuminar()->trackModelEvents(); // Enables model events tracking
$user = User::first();
$user->update(['name' => 'John Doe']); // This event will be tracked
$user->delete();
illuminar()->stopTrackingModelEvents(); // Disables model events tracking
User::create(['name' => 'John Doe']); // This event will not be tracked
illuminar()->trackJobs(); // Enables jobs tracking
Job::dispatch();
illuminar()->stopTrackingJobs(); // Disables jobs tracking
Job::dispatch(); // This job will not be tracked
illuminar()->trackEvents(); // Enables events tracking
event(new UserRegistered($user)); // This event will be tracked
illuminar()->stopTrackingEvents(); // Disables events tracking
event(new UserRegistered($user)); // This event will not be tracked
illuminar()->trackCaches(); // Enables cache tracking
Cache::put('key', 'value', 60); // This cache operation will be tracked
illuminar()->stopTrackingCaches(); // Disables cache tracking
Cache::put('key', 'value', 60); // This cache operation will not be tracked
illuminar()->trackMails(); // Enables mail tracking
Mail::to('[email protected]')->send(new WelcomeMail()); // This mail will be tracked
illuminar()->stopTrackingMails(); // Disables mail tracking
Mail::to('[email protected]')->send(new WelcomeMail()); // This mail will not be tracked
illuminar()->mailable(new WelcomeMail()); // Displays mailable preview
illuminar()->trackHttpRequests(); // Enables request tracking
Http::get('https://illuminar.com'); // This request will be tracked
illuminar()->stopTrackingHttpRequests(); // Disables request tracking
Http::get('https://illuminar.com'); // This request will not be tracked
illuminar()->trackExceptions(); // Enables exceptions tracking
throw new Exception('Something went wrong'); // This exception will be tracked
illuminar()->stopTrackingExceptions(); // Disables exceptions tracking
throw new Exception('Something went wrong'); // This exception will not be tracked