mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-23 13:37:59 +01:00
29 lines
574 B
PHP
29 lines
574 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Api\Web;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\ProfileRequest;
|
|
use Cache;
|
|
use Config;
|
|
use 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);
|
|
}
|
|
}
|