PHP code example of hesamrad / laravel-sql-logger

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

    

hesamrad / laravel-sql-logger example snippets


   'file_lock' => false,
   
bash
php artisan vendor:publish --provider="HesamRad\LaravelSqlLogger\LaravelSqlLoggerServiceProvider"

[2024-01-15 10:30:45] [2.5ms] select * from `users` where `email` = ? ["[email protected]"]
[2024-01-15 10:30:45] [1.2ms] select * from `posts` where `user_id` = ? [1]
[2024-01-15 10:30:45] [0.8ms] select * from `comments` where `post_id` in (?, ?, ?) [1, 2, 3]
------------------------------------------------------------
[2024-01-15 10:31:12] [3.1ms] insert into `users` (`name`, `email`) values (?, ?) ["John Doe", "[email protected]"]
[2024-01-15 10:31:12] [1.5ms] select * from `users` where `id` = ? [42]
------------------------------------------------------------