PHPackages                             salesrender/plugin-core-geocoder - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. salesrender/plugin-core-geocoder

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

salesrender/plugin-core-geocoder
================================

SalesRender plugin geocoder core

0.3.2(4mo ago)01611proprietaryPHPPHP &gt;=7.4.0

Since Jan 19Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/SalesRender/plugin-core-geocoder)[ Packagist](https://packagist.org/packages/salesrender/plugin-core-geocoder)[ RSS](/packages/salesrender-plugin-core-geocoder/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (11)Used By (1)

Plugin Core Geocoder
====================

[](#plugin-core-geocoder)

> Type-specific core framework for SalesRender **GEOCODER** plugins

Overview
--------

[](#overview)

`salesrender/plugin-core-geocoder` is a specialized core library that extends the base `salesrender/plugin-core` to build **Geocoder-type** plugins. Geocoder plugins resolve addresses to geographic coordinates, timezones, and structured address data.

This core provides:

- A `GeocoderInterface` that the developer must implement with actual geocoding logic
- A `GeocoderContainer` for registering the geocoder implementation
- An HTTP endpoint (`POST /protected/geocoder/handle`) for processing geocoding requests
- A `GeocoderResult` value object for returning structured results (address, timezone, info)
- A `Timezone` class supporting both named timezones and UTC offsets
- A `GeocoderAction` that parses requests and invokes the configured geocoder

Installation
------------

[](#installation)

```
composer require salesrender/plugin-core-geocoder
```

### Requirements

[](#requirements)

- PHP &gt;= 7.4
- ext-json
- `salesrender/plugin-core` ^0.4.0 (installed automatically)
- `salesrender/component-address` ^1.0.0 (installed automatically)
- `adbario/php-dot-notation` ^2.2 (installed automatically)

Architecture
------------

[](#architecture)

### How This Core Extends plugin-core

[](#how-this-core-extends-plugin-core)

`plugin-core-geocoder` overrides both factory classes from the base `plugin-core`:

**`WebAppFactory`** (extends `\SalesRender\Plugin\Core\Factories\WebAppFactory`):

- Adds CORS support
- Registers the `GeocoderAction` at `POST /protected/geocoder/handle` with protected middleware

**`ConsoleAppFactory`** (extends `\SalesRender\Plugin\Core\Factories\ConsoleAppFactory`):

- Inherits all base commands without adding new ones (geocoding is synchronous, no queue needed)

### Request Flow

[](#request-flow)

```
SalesRender CRM                          Geocoder Plugin                     External API
      |                                       |                                    |
      |-- POST /protected/geocoder/handle --->|                                    |
      |                                       |-- GeocoderInterface::handle() ---->|
      |                                       |
