gabrielopes01/laravel-extra-validators
最新稳定版本:0.2.0
Composer 安装命令:
composer require gabrielopes01/laravel-extra-validators
包简介
A package with extra validation to Laravel requests
README 文档
README
This package has some extra Validations to Laravel Request's, if you want to use any validator you need to extend on your app service provider adding this line inside the boot function:
use Gabrielopes01\LaravelExtraValidators\ExistsLike;
public function boot()
{
Validator::extend(ExistsLike::handle(), ExistsLike::class);
}
Exists Like
- Add this code line on boot:
Validator::extend(ExistsLike::handle(), ExistsLike::class);
- This validation you can check if the field has a similar value on a specific table/collum, like the example:
'field_req' => 'exists_like:Namespace\Class,collum_name'
Post
- Add this code line on boot:
Validator::extend(Post::handle(), Post::class);
- This validation will exclude the specific value of the request data if the request method doesn't match, like the example:
'field_num' => 'post'
Put
- Add this code line on boot:
Validator::extend(Put::handle(), Put::class);
- This validation will exclude the specific value of the request data if the request method doesn't match, like the example:
'field_num' => 'put'
Delete
- Add this code line on boot:
Validator::extend(Delete::handle(), Delete::class);
- This validation will exclude the specific value of the request data if the request method doesn't match, like the example:
'field_num' => 'delete'
统计信息
- 总下载量: 15
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-01-25