Skip to content

Commit

Permalink
more robust directory detection
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jun 2, 2017
1 parent a617507 commit f6b67d4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Illuminate/Foundation/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Illuminate\Support\Facades\Auth;
use Illuminate\Http\RedirectResponse;
use Whoops\Handler\PrettyPageHandler;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Contracts\Container\Container;
use Illuminate\Session\TokenMismatchException;
Expand Down Expand Up @@ -279,10 +280,13 @@ protected function renderExceptionWithWhoops(Exception $e)
*/
protected function whoopsHandler()
{
return tap(new PrettyPageHandler)->setApplicationPaths([
app_path(), base_path('bootstrap'), config_path(), database_path(),
public_path(), resource_path(), base_path('routes'), storage_path(),
]);
$files = new Filesystem;

return tap(new PrettyPageHandler)->setApplicationPaths(
array_flip(array_except(
array_flip($files->directories(base_path())), [base_path('vendor')]
))
);
}

/**
Expand Down

0 comments on commit f6b67d4

Please sign in to comment.