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
Requires
- illuminate/contracts: ^5.5 | ^6.0
- illuminate/support: ^5.5 | ^6.0
Requires (Dev)
- orchestra/testbench: ^3.8
- phpunit/phpunit: ^7
This package is not auto-updated.
Last update: 2021-02-05 11:53:01 UTC
README
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は有効なスラッグを指定してください。', ];