Files
portal-api/app/Http/Requests/OrderRequest.php
T

37 lines
1.0 KiB
PHP

<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class OrderRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'customer_id' => 'required',
'payment_method' => 'required|integer|min:1',
'status' => 'required',
'product.*.product_id' => 'required|numeric|not__in:0',
'product.*.os_id' => 'nullable|integer',
'product.*.billing' => 'required|not__in:0',
'product.*.quantity' => 'required|min:1',
'product.*.server_name' => 'nullable|string|max:255',
'product.*.price_custom' => 'nullable|integer|min:0',
];
}
}