Pony.fm/app/Http/Controllers/Api/Web/ProfilerController.php

29 lines
654 B
PHP
Raw Normal View History

2015-08-31 16:30:02 +02:00
<?php
2015-09-06 19:21:11 +02:00
namespace App\Http\Controllers\Api\Web;
2015-08-31 16:30:02 +02:00
use App\Http\Controllers\Controller;
use App\ProfileRequest;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Response;
class ProfilerController extends Controller
{
public function getRequest($id)
{
if (!Config::get('app.debug')) {
return;
}
$key = 'profiler-request-' . $id;
$request = Cache::get($key);
if (!$request) {
exit();
}
Cache::forget($key);
return Response::json(['request' => ProfileRequest::load($request)->toArray()], 200);
}
}