Laravel 8 Print Last Query Example

Laravel 8 Print Last Query Example

Hello friends, Today we will show how to print last query in laravel. Sometimes we need to show sql query in laravel. we will learn print last query in laravel 8.  Here you will show laravel 8 get last executed query. We will provide laravel 8 last query, laravel get last query, get last executed query in laravel 8.


namespace App\Http\Controllers;
use App\Models\User;
class UserController extends Controller
     * Create a new controller instance.
     * @return void
    public function index()
        $query = User::select("*")->toSql();

I hope you understand of laravel 8 print last query execute and it can help you…

Read Also :  Laravel Carbon Get Year from Date Example