Last active
February 7, 2016 21:23
-
-
Save jonphipps/3812123555341cefb43f to your computer and use it in GitHub Desktop.
Modified app/Exceptions/Handler.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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