PHPackages                             jaybizzle/safeurl - 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. jaybizzle/safeurl

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

jaybizzle/safeurl
=================

A Laravel package to create safe, SEO friendly urls

v1.2.0(2mo ago)1788.3k↓69.1%7[1 issues](https://github.com/JayBizzle/Safeurl/issues)[1 PRs](https://github.com/JayBizzle/Safeurl/pulls)1MITPHPPHP &gt;=5.6

Since Nov 12Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/JayBizzle/Safeurl)[ Packagist](https://packagist.org/packages/jaybizzle/safeurl)[ Docs](http://github.com/JayBizzle/Safeurl)[ RSS](/packages/jaybizzle-safeurl/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (10)Dependencies (6)Versions (18)Used By (1)

Safeurl
=======

[](#safeurl)

[![Latest Stable Version](https://camo.githubusercontent.com/595e6789b4c6b81259925420c77c11f3292eec6b617b4a0d682834c02837db54/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f4a617942697a7a6c652f5361666575726c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jaybizzle/safeurl) [![Total Downloads](https://camo.githubusercontent.com/c3b14e161eb41835c628856a7193592550c62ae021e73bcb5feb9b496f41a0ec/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f4a617942697a7a6c652f5361666575726c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jaybizzle/safeurl) [![License](https://camo.githubusercontent.com/a0473388b18448945507ead4e05a2d95895d5f8bc71ae973a5e77425435665c1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f4a617942697a7a6c652f5361666575726c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jaybizzle/safeurl) [![Build Status](https://camo.githubusercontent.com/e537f644ba61a7b23a62d0bd8600af0cd95d3a7cb892afb4b6039ed95a571e28/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f4a617942697a7a6c652f5361666575726c2e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/JayBizzle/Safeurl) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/e834cb1c425f98bcc29781b82941ef1eb733df25d71c159f3aeac3ae7daab5df/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f4a617942697a7a6c652f5361666575726c2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/JayBizzle/Safeurl/?branch=master) [![Laravel](https://camo.githubusercontent.com/c62d47cc3c2bd9c4a728e8eda91fb36c623a35e51aa541d1a8131ce7c18ba195/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d352e302e2a2d6666363962342e7376673f7374796c653d666c61742d737175617265)](https://laravel.com)

A Laravel 5 package to create safe, SEO friendly urls

For the Laravel 4 version, see the [v0.1 branch](https://github.com/JayBizzle/Safeurl/tree/v0.1)

Installation
============

[](#installation)

Run `composer require jaybizzle/safeurl 0.2.*` or add `"jaybizzle/safeurl": "0.2.*"` to your `composer.json` file

Add the following to the `providers` array in your `config/app.php` file..

```
  'Jaybizzle\Safeurl\SafeurlServiceProvider',
```

...and the following to your `aliases` array...

```
  'Safeurl'           => 'Jaybizzle\Safeurl\Facades\Safeurl',
```

Usage
=====

[](#usage)

```
echo Safeurl::make('The quick brown fox jumps over the lazy dog');

// Output: the-quick-brown-fox-jumps-over-the-lazy-dog
```

Options
=======

[](#options)

These are the default global options. If you want to define your own global options, publish the config with `php artisan vendor:publish --provider="Jaybizzle\Safeurl\SafeurlServiceProvider"` and change the settings in `config/safeurl.php`.

Options can be individually overridden on each call to `Safeurl::make(string, options)`

```
array(

    'decode'            => true,        // Decode html entities in string?
    'decode_charset'    => 'UTF-8',     // Charset to use if $decode is set to true
    'lowercase'         => true,        // Turns string into all lowercase letters
    'strip'             => true,        // Strip out html tags from string?
    'maxlength'         => 50,          // Maximum length of resulting title
    'whole_word'        => true,        // If maxlength is reached, chop at nearest whole word? or hard chop?
    'blank'             => 'no-title',  // What title to use if no alphanumeric characters can be found
    'separator'         => '-',         // Allow a differnt character to be used as the separator.

    // A table of UTF-8 characters and what to make them.
    'translation_table' => array(
        'Š'=>'S', 'š'=>'s', 'Đ'=>'Dj','Ð'=>'Dj','đ'=>'dj', 'Ž'=>'Z', 'ž'=>'z', 'Č'=>'C', 'č'=>'c', 'Ć'=>'C', 'ć'=>'c',
        'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E',
        'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O',
        'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U', 'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss',
        'à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', 'å'=>'a', 'æ'=>'a', 'ç'=>'c', 'è'=>'e', 'é'=>'e',
        'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i', 'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o',
        'ô'=>'o', 'õ'=>'o', 'ö'=>'o', 'ø'=>'o', 'ù'=>'u', 'ú'=>'u', 'û'=>'u', 'ý'=>'y', 'ý'=>'y', 'þ'=>'b',
        'ÿ'=>'y', 'Ŕ'=>'R', 'ŕ'=>'r', 'ē'=>'e',
        /**
         * Special characters:
         */
        "'"    => '',       // Single quote
        '&'    => ' and ',  // Ampersand
        "\r\n" => ' ',      // Newline
        "\n"   => ' '       // Newline
    )

);
```

Examples
========

[](#examples)

```
echo Safeurl::make('The quick brown fox jumps over the lazy dog', array('maxlength' => 18));

// Output: the-quick-brown
// ** Notice output is only 15 characters event though we specified 18 because we don't want to truncate mid word **
```

```
echo Safeurl::make('The quick brown fox jumps over the lazy dog', array('maxlength' => 18, 'whole_word' => false));

// Output: the-quick-brown-fo
// ** Notice output is now exactly 18 characters **
```

###  Health Score

56

—

FairBetter than 97% of packages

Maintenance86

Actively maintained with recent releases

Popularity39

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 79.5% 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

Every ~298 days

Recently: every ~378 days

Total

15

Last Release

63d ago

Major Versions

v0.7.0 → v1.0.02024-05-09

PHP version history (2 changes)v0.1.0PHP &gt;=5.4.0

v0.6.0PHP &gt;=5.6

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/340752?v=4)[Mark Beech](/maintainers/JayBizzle)[@JayBizzle](https://github.com/JayBizzle)

---

Top Contributors

[![JayBizzle](https://avatars.githubusercontent.com/u/340752?v=4)](https://github.com/JayBizzle "JayBizzle (66 commits)")[![GC-Mark](https://avatars.githubusercontent.com/u/1477806?v=4)](https://github.com/GC-Mark "GC-Mark (9 commits)")[![GC-Max](https://avatars.githubusercontent.com/u/10233281?v=4)](https://github.com/GC-Max "GC-Max (7 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (1 commits)")

---

Tags

urlsluglaravelstringsafeseofriendly url

### Embed Badge

![Health badge](/badges/jaybizzle-safeurl/health.svg)

```
[![Health](https://phpackages.com/badges/jaybizzle-safeurl/health.svg)](https://phpackages.com/packages/jaybizzle-safeurl)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[artesaos/seotools

SEO Tools for Laravel and Lumen

3.4k5.3M63](/packages/artesaos-seotools)[propaganistas/laravel-disposable-email

Disposable email validator

6012.9M7](/packages/propaganistas-laravel-disposable-email)[api-platform/laravel

API Platform support for Laravel

59156.3k11](/packages/api-platform-laravel)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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