PHP code example of sanmanto-sds / laravel-query-log

1. Go to this page and download the library: Download sanmanto-sds/laravel-query-log 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/ */

    

sanmanto-sds / laravel-query-log example snippets


DB::beginTransaction();

$user = User::create([
    'email' => '[email protected]',
    'password' => bcrypt('YP5fQDadZzjcm4E'),
]);

$sql = 'insert into "user_profiles" ("user_id", "first_name", "last_name", "country")';
$sql .= ' values (:user_id, :first_name, :last_name, :country)';

DB::insert($sql, [
    'user_id' => $user->id,
    'first_name' => 'John',
    'last_name' => 'Doe',
    'country' => 'Australia'
]);

DB::commit();

QUERY_LOG_ENABLE=true