This package allows you to manage request validation rules for store and update requests
This package requires PHP 7.2 and Laravel 5.8 or higher.
composer require programic/laravel-rules
# Create Task
php artisan make:rule SaveUserRule
public funtion base(): array
{
return [
'name': 'required,string',
'company': 'required,integer',
];
}
public funtion store(): array
{
return [
'company': 'exists:companies.id',
];
}
public funtion update(): array
{
return [
'name': 'nullable',
]
}
Custom stubs are supported.
php artisan vendor:publish --provider="Programic\Rules\RulesServiceProvider" --tag="stubs"
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security-related issues, please email info@programic.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.