$e->getMessage(), 'exception' => true, 'trace' => collect($e->getTrace()) ->map(function ($trace) { return Arr::only($trace, ['file', 'line']); }) ->filter(function ($trace) { return Arr::has($trace, 'file'); }) ->map(function ($trace) { $trace['file'] = str_replace(base_path().DIRECTORY_SEPARATOR, '', $trace['file']); return $trace; }) ->filter(function ($trace) { // @codeCoverageIgnoreStart $isFromPlugins = ! app()->runningUnitTests() && Str::contains($trace['file'], resolve('plugins')->getPluginsDirs()->all()); // @codeCoverageIgnoreEnd return Str::startsWith($trace['file'], 'app') || $isFromPlugins; }) ->values(), ]; } }