Skip to content

Instantly share code, notes, and snippets.

@jonphipps
Last active February 7, 2016 21:23
Show Gist options
  • Save jonphipps/3812123555341cefb43f to your computer and use it in GitHub Desktop.
Save jonphipps/3812123555341cefb43f to your computer and use it in GitHub Desktop.
Modified app/Exceptions/Handler.php
<?php
...
if ($request->ajax() || $request->wantsJson()) {
$whoops->pushHandler(new JsonResponseHandler());
} else {
$handler = new PrettyPageHandler();
//$handler->setEditor('phpstorm');
$handler->setEditor(
function ($file, $line) {
// if your development server is not local it's good to map remote files to local
$translations = array('^' . env('SERVER_HOME') => env('LOCAL_HOME')); // change to your path
foreach ($translations as $from => $to) {
$file = rawurlencode(preg_replace('#' . $from . '#', $to, $file, 1));
}
return array(
'url' => "phpstorm://open?file=$file&line=$line",
'ajax' => false
);
}
);
$handler->addResourcePath(base_path('app/Exceptions'));
$handler->addCustomCss('whoops.base.css');
$whoops->pushHandler($handler);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment