Files
sam-api/app/Http/Requests/Product/ProductUpdateRequest.php

29 lines
790 B
PHP
Raw Normal View History

<?php
namespace App\Http\Requests\Product;
use Illuminate\Foundation\Http\FormRequest;
class ProductUpdateRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'code' => 'sometimes|string|max:30',
'name' => 'sometimes|string|max:100',
'category_id' => 'sometimes|integer',
'product_type' => 'sometimes|string|max:30',
'attributes' => 'nullable|array',
'description' => 'nullable|string|max:255',
'is_sellable' => 'nullable|in:0,1',
'is_purchasable' => 'nullable|in:0,1',
'is_producible' => 'nullable|in:0,1',
'is_active' => 'nullable|in:0,1',
];
}
}