| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- namespace App\Rules;
- use Illuminate\Contracts\Validation\Rule;
- class ChsDash implements Rule
- {
- /**
- * Create a new rule instance.
- *
- * @return void
- */
- public function __construct()
- {
- //
- }
- /**
- * Determine if the validation rule passes.
- *
- * @param string $attribute
- * @param mixed $value
- * @return bool
- */
- public function passes($attribute, $value)
- {
- $rules = "/^[\x{4e00}-\x{9fa5}a-zA-Z0-9\s\x{3002}\x{ff1f}\x{ff01}\x{ff0c}\x{3001}\x{ff1b}\x{ff1a}\x{201c}\x{201d}\x{2018}\x{2019}\x{ff08}\x{ff09}\x{300a}\x{300b}\x{3008}\x{3009}\x{3010}\x{3011}\x{300e}\x{300f}\x{300c}\x{300d}\x{fe43}\x{fe44}\x{3014}\x{3015}\x{2026}\x{2014}\x{ff5e}\x{fe4f}\x{ffe5}]+$/u";
- return preg_match($rules, $value);
- }
- /**
- * Get the validation error message.
- *
- * @return string
- */
- public function message()
- {
- return trans('validation.chsdash');
- }
- }
|