Files
fotospiel-app/app/Http/Requests/Checkout/CheckoutFreeActivationRequest.php

43 lines
1.1 KiB
PHP

<?php
namespace App\Http\Requests\Checkout;
use Illuminate\Foundation\Http\FormRequest;
class CheckoutFreeActivationRequest 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 [
'package_id' => ['required', 'exists:packages,id'],
'accepted_terms' => ['required', 'boolean', 'accepted'],
'accepted_waiver' => ['nullable', 'boolean'],
'locale' => ['nullable', 'string', 'max:10'],
];
}
/**
* Get custom validation messages.
*/
public function messages(): array
{
return [
'package_id.exists' => 'Das ausgewählte Paket ist ungültig.',
'accepted_terms.accepted' => 'Bitte akzeptiere die Nutzungsbedingungen.',
];
}
}