FEATURE: add simple view for requests and queries

This commit is contained in:
Michal Kváček
2017-03-02 20:04:35 +01:00
parent d99c046103
commit 9c90e844b0
23 changed files with 347 additions and 54 deletions
@@ -1,12 +1,16 @@
<?php namespace Modules\Profiler\Http\Controllers;
use Pingpong\Modules\Routing\Controller;
use App\Http\Controllers\Admin\Controller;
use Modules\Profiler\Entities\HttpLog;
class ProfilerController extends Controller {
public function index()
{
return view('profiler::index');
}
class ProfilerController extends Controller
{
public function index()
{
$httpLog = HttpLog::orderBy('created_at', 'DESC')
->with('queries')
->paginate(25);
return view('profiler::index', compact('httpLog'));
}
}
@@ -0,0 +1,13 @@
<?php
namespace Modules\Profiler\Http\Controllers;
use App\Http\Controllers\Admin\Controller;
use Modules\Profiler\Entities\HttpLog;
class QueryController extends Controller {
public function index(HttpLog $httpLog) {
$queries = $httpLog->queries;
return view('profiler::queries.index', compact('queries'));
}
}
+11 -3
View File
@@ -1,6 +1,14 @@
<?php
Route::group([
'prefix' => LaravelLocalization::setLocale(),
'namespace' => 'Modules\Profiler\Http\Controllers'
], function () {
Route::group([
'middleware' => ['admin'],
'prefix' => 'profiler'
], function () {
Route::group(['middleware' => 'web', 'prefix' => 'profiler', 'namespace' => 'Modules\Profiler\Http\Controllers'], function()
{
Route::get('/', 'ProfilerController@index');
Route::get('/', 'ProfilerController@index')->name('profiler.index');
Route::get('{httpLog}/queries', 'QueryController@index')->name('queries.index');
});
});