$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) { return \Illuminate\Support\Str::startsWith($trace['file'], 'app'); }) ->values(), ]; } }