PHPackages                             seeds-std/laravel-slug-rule - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. seeds-std/laravel-slug-rule

AbandonedLibrary[Validation &amp; Sanitization](/categories/validation)

seeds-std/laravel-slug-rule
===========================

Slug rule

0.0.1(6y ago)06MITPHPCI failing

Since Jan 23Pushed 6y ago1 watchersCompare

[ Source](https://github.com/seeds-std/laravel-slug-rule)[ Packagist](https://packagist.org/packages/seeds-std/laravel-slug-rule)[ RSS](/packages/seeds-std-laravel-slug-rule/feed)WikiDiscussions master Synced 1mo ago

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

Slug validation rules for Laravel
=================================

[](#slug-validation-rules-for-laravel)

[![Build Status](https://camo.githubusercontent.com/a0b4476b109049edfb0ac0d53412c8b25fc0ffcbce2628fa395e72fde0256d79/68747470733a2f2f7472617669732d63692e636f6d2f73656564732d7374642f6c61726176656c2d736c75672d72756c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/seeds-std/laravel-slug-rule)[![codecov](https://camo.githubusercontent.com/f7004236f36d200119b1af6a678c5b9304ab287378cc67b79ff4c065830833ad/68747470733a2f2f636f6465636f762e696f2f67682f73656564732d7374642f6c61726176656c2d736c75672d72756c652f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/seeds-std/laravel-slug-rule)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/0dc2b1a8a4da9de3a605a7a25ea86ddbd363ba56f027ab5ca79882f43966a18a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73656564732d7374642f6c61726176656c2d736c75672d72756c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/seeds-std/laravel-slug-rule/?branch=master)

To check whether the slug is valid format with Str::slug().

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

[](#installation)

```
composer require seeds-std/laravel-slug-rule
```

Usage
-----

[](#usage)

```
Validator::make(['slug' => 'laravel-5-framework'], ['name' => new \SeedsStd\SlugValidation\Slug()])
    ->passes(); // true
```

### Options

[](#options)

- separator

```
Validator::make(['slug' => 'laravel_5_framework'], ['name' => new \SeedsStd\SlugValidation\Slug(['separator' => '_'])])
    ->passes(); // true
```

Translation
-----------

[](#translation)

Translate validation messages with `resources/lang/ja/validation.php`

```
