PHPackages                             theabhishekin/filament-location - 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. theabhishekin/filament-location

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

theabhishekin/filament-location
===============================

A Filament package for collecting and displaying user locations with Google Maps integration

v1.0.0(11mo ago)06MITPHPPHP ^8.1CI failing

Since Jun 7Pushed 11mo agoCompare

[ Source](https://github.com/TheAbhishekIN/filament-location)[ Packagist](https://packagist.org/packages/theabhishekin/filament-location)[ RSS](/packages/theabhishekin-filament-location/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (12)Versions (2)Used By (0)

Filament Location
=================

[](#filament-location)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b0c9df00d2d9d900596c05f9edd4726899066e901ec9b999b519b0458a7acd60/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746865616268697368656b696e2f66696c616d656e742d6c6f636174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/theabhishekin/filament-location)[![GitHub Tests Action Status](https://camo.githubusercontent.com/76e1148525adf08343e65ba37df07c7d6159b32024fade9becdc1bfec1bb7ce7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f746865616268697368656b696e2f66696c616d656e742d6c6f636174696f6e2f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/theabhishekin/filament-location/actions/workflows/tests.yml)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/4cf0a0ab42bd89dc68d1224984b0c2a96e1ffae412db1945bcb46a4443ee4489/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f746865616268697368656b696e2f66696c616d656e742d6c6f636174696f6e2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/theabhishekin/filament-location/actions/workflows/fix-php-code-style-issues.yml)[![Total Downloads](https://camo.githubusercontent.com/c98f1239d551fca19ed4cbe4f03853eb1ebb0f1cc84fd445cf0399c3c51868cc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746865616268697368656b696e2f66696c616d656e742d6c6f636174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/theabhishekin/filament-location)

A powerful Filament package for collecting and displaying user locations with Google Maps integration. This package provides easy-to-use location picker and display components for your Filament admin panels.

Features
--------

[](#features)

- 🗺️ **LocationPicker**: Interactive Google Maps component for forms
- 📍 **LocationColumn**: Display locations in tables with clickable map modals
- 🎯 **Current Location**: Get user's current location with GPS
- 🔧 **Highly Customizable**: Configurable zoom, map types, controls, and styling
- 📱 **Responsive Design**: Works perfectly on desktop and mobile
- 🌍 **Multiple Location Types**: Support for home, office, check-in/out locations
- 📊 **Distance Calculations**: Built-in distance calculation utilities
- 🎨 **Custom Icons**: Predefined and custom icon support

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

[](#installation)

You can install the package via Composer:

```
composer require theabhishekin/filament-location
```

Publish the configuration file:

```
php artisan vendor:publish --tag="filament-location-config"
```

Add your Google Maps API key to your `.env` file:

```
GOOGLE_MAPS_API_KEY=your_google_maps_api_key_here
```

> **Note**: Make sure to enable the **Maps JavaScript API** and **Geocoding API** in your Google Cloud Console.

Configuration
-------------

[](#configuration)

The configuration file allows you to customize default settings:

```
return [
    'google_maps_api_key' => env('GOOGLE_MAPS_API_KEY'),
    'default_zoom' => 15,
    'map_height' => '400px',
    'enable_street_view' => true,
    'map_type' => 'standard', // standard, satellite, hybrid, terrain
    'location_accuracy' => 100,
    'location_timeout' => 10000,
    'enable_high_accuracy' => true,
    'map_controls' => [
        'zoom_control' => true,
        'map_type_control' => true,
        'scale_control' => true,
        'street_view_control' => true,
        'rotate_control' => true,
        'fullscreen_control' => true,
    ],
];
```

Database Migration
------------------

[](#database-migration)

Add location fields to your model's migration:

```
Schema::table('users', function (Blueprint $table) {
    $table->json('location')->nullable();
    $table->timestamp('location_updated_at')->nullable();
});
```

Model Setup
-----------

[](#model-setup)

Add the `HasLocation` trait to your model:

```
