PHP code example of lensapp-eu / lens-php

1. Go to this page and download the library: Download lensapp-eu/lens-php 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/ */

    

lensapp-eu / lens-php example snippets


lens('hello');
lens($user)->green()->label('Signed-in user');
lens(['order' => $order, 'total' => $amount]);

// A single value
lens('checkpoint reached');

// Multiple values at once
lens($request->all(), $user, $total);

// Chaining: label and color
lens($order)->label('New order')->green();

// Clear the screen
\LensApp\Lens\Lens::clear();

lens($exception);                          // a Throwable is detected automatically
\LensApp\Lens\Lens::exception($e);   // explicit

\LensApp\Lens\Lens::showQueries();
\LensApp\Lens\Lens::showMails();   // shows the email's HTML in a sandboxed preview
\LensApp\Lens\Lens::showJobs();
\LensApp\Lens\Lens::showEvents();
\LensApp\Lens\Lens::showModels();

\LensApp\Lens\Lens::pause();



use LensApp\Lens\Lens;

Lens::configure('127.0.0.1', 23600); // optional; these are the defaults
lens('works without a framework too');
json
"config": {
  "allow-plugins": {
    "lensapp-eu/lens-php": true
  }
}
bash
php artisan lens:install-hooks
sh
php artisan lens:check --staged || exit 1
bash
php artisan vendor:publish --tag=lens-config