我已经安装:https ://github.com/barryvdh/laravel-debugbar使用作曲家。
我按照安装程序,现在完成了。
但是如何查看我的 PDO mysql 查询?我正在构建一个 RESTful api,没有任何 HTML/视图渲染。
不知道它是否有任何用途,但这是我的代码的一些示例:
// the controller
public function feed($exclude = null) {
$feed = $this->item->feed()->with('attributes', 'images', 'user');
if($exclude)
$feed->whereNotIn('id', explode(',', $exclude));
return ['items' => $this->itemTransformer->transformCollection($feed->get()->toArray())]; // woud like to debug this query
}
// the router
Route::get('items/feed/{exclude?}', ['protected' => true, 'uses' => 'ItemsController@feed']);