Wednesday, June 1, 2022

Setup a master password for your laravel application.

 Most of the time we face issue, to login other's account to help them. But we cannot ask them.

 Solution is to setup master password so that each account have 2 password.


  Follow the following steps

  Step1:-  Install composer 

                composer require imanghafoori/laravel-masterpass

   Step2:-  Then, do not forget to run:

                 php artisan vendor:publish --tag=master_password

   Step3:- Add this to your .env

                MASTER_PASSWORD=mySecretMasterPass

               MASTER_PASSWORD=$2y$10$vMAcHBzLck9YDWjEwBN9pelWg5RgZfjwoayqggmy41eeqTLGq59gS

  



Saturday, May 7, 2022

Enable query log Laravel

 Use the enableQueryLog method: Use the enableQueryLog method:

DB::connection()->enableQueryLog();



We can get an array of the executed queries by using the getQueryLog method:

$queries = DB::getQueryLog();