diff --git a/CHANGELOG.md b/CHANGELOG.md index afba72d..276a9b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [4.0.21] - 3 Nov 2018 +### Added +- `->toJson()` method when querying results. + ## [4.0.10] - 1 Jul 2018 ### Changed - service provider to register singleton and alias in `register()` method. diff --git a/src/ProviderAndDumperAggregator.php b/src/ProviderAndDumperAggregator.php index a5a86af..64c4a52 100644 --- a/src/ProviderAndDumperAggregator.php +++ b/src/ProviderAndDumperAggregator.php @@ -51,6 +51,13 @@ public function get() : Collection return $this->results; } + public function toJson() : string + { + return $this + ->dump("geojson") + ->first(); + } + public function dump(string $dumper) : Collection { $dumperClasses = collect([