Hello to all, welcome to therichpost.com. In this post, I will tell you, How to print query in laravel? Like I always say that laravel is the best Mvc php framework.
Here is the working code to print query in laravel:
DB::enableQueryLog(); $user = DB::table('user')->where('email','!=','test')->get(); $query = DB::getQueryLog(); $query = end($query); print_r($query); die();
or, you can try this one also:
$user = DB::table('user')->where('email','!=','test')->toSql(); dd($user);
Hello to all. Welcome to therichpost.com. Myself Ajay Malhotra and I am full stack developer. I love coding. I know Wordpress, Core php, Angularjs, Angular 2, Angular 6, laravel, Codeigniter, Shopify, Squarespace, Jquery, Google Map Api, Vuejs, Reactjs, Bigcommerce etc.
All posts byAjay Malhotra