To enable and get query log in laravel; Just use enableQueryLog to enable query log and use DB::getQueryLog() to print log in laravel. By default, Laravel’s query builder has two enableQueryLog and getQueryLog methods that you can use to get
Category: Laravel
A PHP Laravel Framework is a basic platform that allows us to develop web applications. In other words, it provides structure. By using a PHP Laravel Framework, you will end up saving loads of time, stopping the need to produce repetitive code, and you’ll be able to build applications rapidly (RAD).Laravel Tutorial – Learn Laravel in simple way starting from basic to advanced concepts with examples. Laravel Tutorial For Beingners, In this Laravel Tutorial Learn Laravel Step By Step Guide to Building Your Laravel Applications. Also Learn Laravel Topics Like Laravel Installation, Laravel Passport, Laravel Email Verification, Laravel Pagination, Laravel Rest full apis, Laravel Crud. A complete step by step guide. widows and ubuntu both system are installation process here.
How to Get or Print Last Executed Query in Laravel
To get or print the last executed query in Laravel, simply enable the query log using the DB::enableQueryLog() method and print the last executed query using the DB::getQueryLog() method. Also, you can use toSQL() function with a query, and print
Read More How to Get or Print Last Executed Query in Laravel
How to Remove Column From Existing Tables in Laravel Migration
Dropping a column in laravel using migrations; Simply open your migration file and add DropColumn() method along with the column name in migration file and after that, run the PHP Artisan migrate command on CMD or command line. The dropIfExists
Read More How to Remove Column From Existing Tables in Laravel Migration
How to Take Browser Screenshots in Laravel
Taking screenshots of browsers is very easy in Laravel applications with the help of spatie/browsershot package. Just install spatie/browsershot in laravel project and use its object browsershot, you can take screenshots of browser. How to Take Browser Screenshot in Laravel
Laravel Error Call to Member Function store() on Null
If you are uploading files using ajax in Laravel and at that time, face error fatal call in a member function store() on null, It means you are missing something in your ajax request or your controller file. So, in
Read More Laravel Error Call to Member Function store() on Null
Laravel Clear Cache Programmatically & Artisan Command
To clear the cache programmatically and artisan commands in Laravel applications Use a facade of cache to clear all types of caches programmatically, and you can also use different php artisan commands to clear the cache of routes, config, app,
Read More Laravel Clear Cache Programmatically & Artisan Command
How to Clear Cache on Laravel 11|10|9
To clear all types of cache such as route, config, view, and app in laravel, Just open your command line or CMD and use the PHP Artisan command to clear cache from your Laravel application or project. In Laravel project
Laravel Remove Public\index.php from URL using htaccess
To remove public /index.php from url in laravel; Simply copy .htaccess file from public folder to laravel project root folder and create new index.php file in root folder. In this tutorial guide, you will find very easy two options that
Read More Laravel Remove Public\index.php from URL using htaccess
sqlstate(hy000 error 1045) access denied for user laravel
The error SQLSTATE [HY000] [1045] Access denied for user ‘root’@’localhost’ (using password: YES) or (using password: Now) comes in two conditions, The first is that you have not configured the database correctly with Laravel, or else your application is cached.
Read More sqlstate(hy000 error 1045) access denied for user laravel
Laravel Time Difference Between Two Carbon Dates in Hours, Minutes, Seconds
Sometimes there is a need to calculate the difference between two dates or timestamps to get the time difference between in hours, minutes seconds, etc, For this, Carbon library also has functions like diffInHours, diffInMinutes and diffInSeconds, Which you can
Read More Laravel Time Difference Between Two Carbon Dates in Hours, Minutes, Seconds