update validations ISO crud policies
This commit is contained in:
parent
823c4f1e3c
commit
2d2aae3834
4 changed files with 9 additions and 7 deletions
|
|
@ -24,7 +24,7 @@ class StoreAnswerRequest extends FormRequest
|
|||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'answer' => 'required|string|min:3|max:255',
|
||||
'answer' => 'required|string|min:1|max:255',
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class StoreBrandRequest extends FormRequest
|
|||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|min:3|max:255',
|
||||
'name' => 'required|string|min:5|max:255',
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@
|
|||
|
||||
namespace App\Http\Requests\Questions;
|
||||
|
||||
use App\Enums\QuestionType;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Kwaadpepper\Enum\Rules\EnumIsValidRule;
|
||||
|
||||
class StoreQuestionRequest extends FormRequest
|
||||
{
|
||||
|
|
@ -24,9 +26,9 @@ class StoreQuestionRequest extends FormRequest
|
|||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'question' => 'required|string|min:5|max:255',
|
||||
'type' => 'required|integer|min:0',
|
||||
'brand_id' => 'required|integer|min:0',
|
||||
'question' => 'required|string|min:10|max:255',
|
||||
'type' => ['required', new EnumIsValidRule(QuestionType::class)],
|
||||
'brand_id' => 'required|integer|min:0|exists:brands,id',
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ class StoreServiceRequest extends FormRequest
|
|||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|min:3|max:255',
|
||||
'brand_id' => 'required|integer|min:0',
|
||||
'name' => 'required|string|min:5|max:255',
|
||||
'brand_id' => 'required|integer|min:0|exists:brands,id',
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue