Skip to content

Commit

Permalink
Add tojson method
Browse files Browse the repository at this point in the history
Fixes #101
  • Loading branch information
mikebronner committed Nov 3, 2018
1 parent 792da3d commit 1140830
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 7 additions & 0 deletions src/ProviderAndDumperAggregator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down

0 comments on commit 1140830

Please sign in to comment.