PHPackages                             sslah/location-finder - 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. [API Development](/categories/api)
4. /
5. sslah/location-finder

ActiveLibrary[API Development](/categories/api)

sslah/location-finder
=====================

🚀 Laravel Location Finder - Pure API Service for geocoding with OpenStreetMap/Nominatim. Framework-agnostic, no UI dependencies. Perfect for Turkish addresses!

v2.0.0(10mo ago)07MITPHPPHP ^8.1

Since Jul 15Pushed 10mo agoCompare

[ Source](https://github.com/ahmetsuslu/location-finder)[ Packagist](https://packagist.org/packages/sslah/location-finder)[ Docs](https://github.com/ahmetsuslu/location-finder)[ RSS](/packages/sslah-location-finder/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

🚀 Laravel Location Finder - API Service
=======================================

[](#-laravel-location-finder---api-service)

**Pure API service for OpenStreetMap/Nominatim address search and geocoding.**

> **Zero UI Dependencies** - Only provides backend API endpoints. Frontend implementation is up to you.

✅ Installation
--------------

[](#-installation)

```
composer require sslah/location-finder
```

```
php artisan location-finder:install
```

🚀 Usage
-------

[](#-usage)

### 🎭 Using Facade (Recommended)

[](#-using-facade-recommended)

```
use LocationFinder;

// Search for locations
$results = LocationFinder::search('ankara');

// Geocode an address to get coordinates
$location = LocationFinder::geocode('Kızılay, Ankara');

// Reverse geocode coordinates to get address
$address = LocationFinder::reverseGeocode(39.9208, 32.8541);
```

### 🔧 Using Dependency Injection

[](#-using-dependency-injection)

```
use Sslah\LocationFinder\Services\GeocodingService;

class LocationController
{
    public function __construct(private GeocodingService $locationFinder)
    {
    }

    public function search(Request $request)
    {
        $results = $this->locationFinder->search($request->query);
        return response()->json($results);
    }
}
```

🎯 API Endpoints
---------------

[](#-api-endpoints)

### Search Address

[](#search-address)

```
GET /api/location-finder/search?query=istanbul
```

**Response:**

```
{
    "success": true,
    "results": [
        {
            "address": "İstanbul, Türkiye",
            "lat": 41.0082,
            "lng": 28.9784
        }
    ],
    "count": 1
}
```

### Geocode Address

[](#geocode-address)

```
POST /api/location-finder/geocode
Content-Type: application/json

{
    "address": "İstanbul, Türkiye"
}
```

### Reverse Geocode

[](#reverse-geocode)

```
POST /api/location-finder/reverse-geocode
Content-Type: application/json

{
    "lat": 41.0082,
    "lng": 28.9784
}
```

🔧 Configuration
---------------

[](#-configuration)

```
// config/location-finder.php
return [
    'service' => [
        'provider' => 'nominatim',
        'base_url' => 'https://nominatim.openstreetmap.org',
        'user_agent' => 'Laravel Location Finder',
        'timeout' => 10,
    ],
    'search' => [
        'min_chars' => 3,
        'max_results' => 10,
        'country_code' => 'tr',
        'language' => 'tr',
    ],
    'cache' => [
        'enabled' => true,
        'ttl' => 3600,
    ],
];
```

💡 Frontend Implementation Examples
----------------------------------

[](#-frontend-implementation-examples)

### Vanilla JavaScript

[](#vanilla-javascript)

```

document.getElementById('address-search').addEventListener('input', function(e) {
    const query = e.target.value;

    if (query.length  response.json())
        .then(data => {
            const resultsDiv = document.getElementById('results');
            resultsDiv.innerHTML = '';

            data.results.forEach(result => {
                const div = document.createElement('div');
                div.innerHTML = `
                    ${result.address}
                    Lat: ${result.lat}, Lng: ${result.lng}
                `;
                div.addEventListener('click', () => {
                    console.log('Selected:', result);
                });
                resultsDiv.appendChild(div);
            });
        });
});

```

### jQuery

[](#jquery)

```
$('#address-search').on('input', function() {
    const query = $(this).val();

    if (query.length
                        ${result.address}
                        Lat: ${result.lat}, Lng: ${result.lng}

                `);
            });
        });
});
```

### Vue.js

[](#vuejs)

```

            {{ result.address }}
            Lat: {{ result.lat }}, Lng: {{ result.lng }}

export default {
    data() {
        return {
            query: '',
            results: []
        }
    },
    methods: {
        search() {
            if (this.query.length  response.json())
                .then(data => {
                    this.results = data.results;
                });
        },
        selectResult(result) {
            console.log('Selected:', result);
        }
    }
}

```

### React

[](#react)

```
import React, { useState } from 'react';

function AddressSearch() {
    const [query, setQuery] = useState('');
    const [results, setResults] = useState([]);

    const handleSearch = async (e) => {
        const value = e.target.value;
        setQuery(value);

        if (value.length  (
                     console.log('Selected:', result)}>
                        {result.address}
                        Lat: {result.lat}, Lng: {result.lng}

                ))}

    );
}
```

🌍 OpenStreetMap Integration
---------------------------

[](#-openstreetmap-integration)

This package uses OpenStreetMap's Nominatim API:

- **Free** - No API keys required
- **Global** - Worldwide address coverage
- **Accurate** - High-quality geocoding data
- **No limits** - Reasonable usage is free

📊 Response Format
-----------------

[](#-response-format)

All endpoints return standardized JSON responses:

```
{
    "success": true,
    "results": [
        {
            "address": "Full formatted address",
            "lat": 41.0082,
            "lng": 28.9784
        }
    ],
    "count": 1
}
```

Error responses:

```
{
    "success": false,
    "error": "Error message",
    "results": [],
    "count": 0
}
```

🔧 Advanced Usage
----------------

[](#-advanced-usage)

### Custom Service Provider

[](#custom-service-provider)

```
// In your AppServiceProvider
use Sslah\LocationFinder\Services\GeocodingService;

public function boot()
{
    $this->app->bind(GeocodingService::class, function ($app) {
        return new GeocodingService([
            'country_code' => 'us',
            'language' => 'en',
            'max_results' => 5,
        ]);
    });
}
```

### Direct Service Usage

[](#direct-service-usage)

```
use Sslah\LocationFinder\Services\GeocodingService;

class MyController extends Controller
{
    public function search(Request $request, GeocodingService $geocoding)
    {
        $results = $geocoding->search($request->input('query'));

        return response()->json($results);
    }
}
```

🎯 Why This Package?
-------------------

[](#-why-this-package)

### ✅ **Pure API Service**

[](#-pure-api-service)

- No frontend dependencies
- Framework agnostic
- Use with any CSS framework
- Implement your own UI

### ✅ **OpenStreetMap Powered**

[](#-openstreetmap-powered)

- Free and open source
- No API keys required
- Global coverage
- High accuracy

### ✅ **Laravel Integration**

[](#-laravel-integration)

- Service provider included
- Configuration file
- Caching support
- Error handling

### ✅ **Developer Friendly**

[](#-developer-friendly)

- Clean API endpoints
- Standardized responses
- Easy to integrate
- Well documented

📝 License
---------

[](#-license)

MIT License

🔗 Links
-------

[](#-links)

- GitHub:
- Packagist:
- OpenStreetMap:
- Nominatim API:

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance55

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

304d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8353ddc5d7d010c4444e582bec5492e54cb7f6efff7af9def9261aa533e1c6e2?d=identicon)[sslah](/maintainers/sslah)

---

Top Contributors

[![ahmetsuslu](https://avatars.githubusercontent.com/u/7262009?v=4)](https://github.com/ahmetsuslu "ahmetsuslu (9 commits)")

---

Tags

laravelgeocodingcoordinatesnominatimOpenStreetMapaddress searchreverse-geocodinglocation-finder

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sslah-location-finder/health.svg)

```
[![Health](https://phpackages.com/badges/sslah-location-finder/health.svg)](https://phpackages.com/packages/sslah-location-finder)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[statamic/cms

The Statamic CMS Core Package

4.8k3.2M720](/packages/statamic-cms)[nickurt/laravel-postcodeapi

Universal PostcodeApi for Laravel 11.x/12.x/13.x

97221.2k](/packages/nickurt-laravel-postcodeapi)[mozex/anthropic-laravel

Anthropic PHP for Laravel is a supercharged PHP API client that allows you to interact with the Anthropic API

71226.4k1](/packages/mozex-anthropic-laravel)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

762.6k](/packages/scriptdevelop-whatsapp-manager)[riverside/php-nominatim

PHP client for Nominatim, a search engine for OpenStreetMap data.

1225.9k1](/packages/riverside-php-nominatim)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
