我已经安装:https://github.com/barryvdh/laravel-debugbar使用作曲家。Laravel 4和debugbar - 显示pdo查询?
我遵循安装程序,现在就完成了。
但是我如何看到我的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' => '[email protected]']);