seeds-std/laravel-slug-rule

This package is abandoned and no longer maintained. No replacement package was suggested.

Slug rule

0.0.1 2020-01-23 07:56 UTC

This package is not auto-updated.

Last update: 2021-02-05 11:53:01 UTC


README

Build Status codecov Scrutinizer Code Quality

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

Installation

composer require seeds-std/laravel-slug-rule

Usage

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

Options

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

Translation

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

<?php

return [
    'slug' => ':attributeは有効なスラッグを指定してください。',
];