File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -14,3 +14,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1414* [ 1.0.0] ( #400---2019-12-02 ) - Initial release
1515* [ 1.1.0] ( #400---2019-12-05 ) - Adds ability to force scope driver in config
1616* [ 1.1.1] ( #400---2019-12-31 ) - Removes default scope driver
17+ * [ 1.2.0] ( #400---2019-12-31 ) - Adds PostgreSQL scope driver
Original file line number Diff line number Diff line change @@ -117,7 +117,13 @@ Any missing config options will be replaced with the defaults defined in `config
117117Under the hood, GeoScope uses different drivers to ensure that the distance queries are optimised to the database connection
118118being used. Scope drivers correspond to the database drivers used by Laravel. GeoScope will automatically detect the database driver being used
119119by Laravel and choose the correct scope driver for it. Out of the box GeoScope includes a MySQL scope driver
120- which uses the built in ` ST_Distance_Sphere() ` function.
120+ which uses ` ST_Distance_Sphere() ` function and a PostgreSQL scope driver which uses ` earth_distance ` .
121+
122+ ** NOTE: The PostgreSQL driver requires you to have the postgres ` earthdistance ` module installed which can be done by executing the following SQL**
123+ ``` sql
124+ create extension if not exists cube;
125+ create extension if not exists earthdistance;
126+ ```
121127
122128#### Creating Custom Scope Drivers
123129GeoScope allows you to define and register custom scope drivers. To create a custom scope driver create a class that extends
Original file line number Diff line number Diff line change 55use Netsells \GeoScope \Exceptions \ScopeDriverNotFoundException ;
66use Netsells \GeoScope \Interfaces \ScopeDriverInterface ;
77use Netsells \GeoScope \ScopeDrivers \MySQLScopeDriver ;
8+ use Netsells \GeoScope \ScopeDrivers \PostgreSQLScopeDriver ;
89
910class ScopeDriverFactory
1011{
@@ -13,6 +14,7 @@ class ScopeDriverFactory
1314 */
1415 protected $ registeredStrategies = [
1516 'mysql ' => MySQLScopeDriver::class,
17+ 'pgsql ' => PostgreSQLScopeDriver::class,
1618 ];
1719
1820 /**
You can’t perform that action at this time.
0 commit comments