PHPackages                             rayzenai/url-manager - 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. rayzenai/url-manager

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

rayzenai/url-manager
====================

Laravel URL management package with Filament integration for SEO-friendly URLs, redirects, and sitemap generation

v1.7.0(3mo ago)0939MITPHPPHP ^8.3

Since Sep 1Pushed 3mo agoCompare

[ Source](https://github.com/rayzenai/url-manager)[ Packagist](https://packagist.org/packages/rayzenai/url-manager)[ RSS](/packages/rayzenai-url-manager/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (28)Used By (0)

RayzenAI URL Manager
====================

[](#rayzenai-url-manager)

A comprehensive Laravel package for managing URLs, redirects, and sitemaps with Filament admin panel integration.

Features
--------

[](#features)

- 🔗 **Dynamic URL Management** - Manage all your application URLs from a central location
- 🔄 **301/302 Redirects** - Create and manage URL redirects with configurable status codes
- 🔄 **Automatic Redirect Creation** - Update slugs safely with automatic old→new redirects
- 🗺️ **Automatic Sitemap Generation** - Generate XML sitemaps with support for large sites
- 📊 **Visit Tracking** - Track URL visits with country detection, device info, and mobile app support
- 🎨 **Filament Integration** - Full-featured admin panel with UrlInput form component
- 🏷️ **SEO Metadata** - Manage meta tags and Open Graph data
- 🚀 **Performance Optimized** - Efficient database queries with proper indexing
- 🔒 **Redirect Loop Protection** - Automatic detection and prevention of circular redirects (A→B→A, A→B→C→A)

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 11.0+ or 12.0+
- Filament 4.0+
- Stevebauman/Location 7.0+ with MaxMind database (for visitor country detection)
- kirantimsina/file-manager (optional, for media SEO functionality)

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

[](#installation)

### Step 1: Install via Composer

[](#step-1-install-via-composer)

```
composer require rayzenai/url-manager
```

### Optional: Install File Manager for Enhanced SEO

[](#optional-install-file-manager-for-enhanced-seo)

For complete media SEO functionality, install the companion file-manager package:

```
composer require kirantimsina/file-manager
```

This package provides:

- Media metadata tracking with SEO titles
- Image optimization and compression
- Enhanced file upload components for Filament

### Step 2: Publish Configuration

[](#step-2-publish-configuration)

```
php artisan vendor:publish --tag=url-manager-config
```

### Step 3: Configure Location Service (Required for visitor tracking)

[](#step-3-configure-location-service-required-for-visitor-tracking)

The URL Manager uses the Stevebauman/Location package to detect visitor countries from IP addresses. You need to set up MaxMind's GeoIP database:

#### Option A: Use Local Database (Recommended)

[](#option-a-use-local-database-recommended)

1. Download the free GeoLite2 City database from [MaxMind](https://dev.maxmind.com/geoip/geoip2/geolite2/)
2. Create a free account and download `GeoLite2-City.mmdb`
3. Place the file in your Laravel project: `database/maxmind/GeoLite2-City.mmdb`
4. Publish and configure the Location package:

```
php artisan vendor:publish --provider="Stevebauman\Location\LocationServiceProvider"
```

5. Update `config/location.php`:

```
'driver' => Stevebauman\Location\Drivers\MaxMind::class,

'maxmind' => [
    'local' => [
        'type' => 'city', // or 'country' for smaller file
        'path' => database_path('maxmind/GeoLite2-City.mmdb'),
    ],
],
```

#### Option B: Use Web Service

[](#option-b-use-web-service)

Configure MaxMind web service in your `.env`:

```
MAXMIND_USER_ID=your_user_id
MAXMIND_LICENSE_KEY=your_license_key
```

### Step 4: Run Migrations

[](#step-4-run-migrations)

```
php artisan vendor:publish --tag=url-manager-migrations
php artisan migrate
```

This will create the following tables:

- `urls` - For managing URLs and redirects
- `url_visits` - For tracking visitor analytics
- `google_search_console_settings` - For storing Google Search Console credentials securely

### Step 5: Register with Filament

[](#step-5-register-with-filament)

Add the plugin to your Filament panel configuration (typically in `app/Providers/Filament/AdminPanelProvider.php`):

```
use RayzenAI\UrlManager\UrlManagerPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ... other configuration
        ->plugin(UrlManagerPlugin::make());
}
```

### Step 5: Configure Your Models

[](#step-5-configure-your-models)

Add the `HasUrl` trait to any model that needs URL management:

```
