I tried to figure out a way to write SQL queries from Eloquent ORM, which I use in Zend Framework 1. I came across the getQueryLog () method, called as follows:
$queries = DB::getQueryLog();
I found Illuminate \ Database \ Connection to contain the getQueryLog () method, so I tried to do the following:
use Illuminate\Database\Connection as DB; class IndexController { . . . public function indexAction() {
However, I get the following notification and return NULL: Notice: Undefined property: IndexController::$queryLog in /var/www/qasystem/vendor/illuminate/database/Illuminate/Database/Connection.php on line 918 NULL
Can anyone suggest how I can use this outside of Laravel? I searched the Internet and see nothing that I need to do differently, although I suspect that most of the examples will be used in Laravel. Also, is Illuminate \ Database \ Connection the right class? Thanks
source share