This repository has been archived on 2025-12-04. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
vollstock 8703e5ff40
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
Add initial Code
2025-10-20 08:57:51 +02:00

42 lines
1.4 KiB
PHP

<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class StoreCustomerRequest extends FormRequest
{
public function authorize(): bool
{
return true; // Autorisierung später über Policies/Gates
}
public function rules(): array
{
return [
'type' => 'required|in:private,business',
'company_name' => [
'required_if:type,business',
'nullable',
'string',
'max:100',
],
'first_name' => 'required|string|max:50',
'last_name' => 'required|string|max:50',
'email' => 'required|email|unique:customers,email|max:100',
'phone' => 'nullable|string|max:20',
'tax_number' => 'nullable|string|max:50',
'vat_id' => 'nullable|string|max:50',
'billing_address' => 'required|array',
'billing_address.street' => 'required|string|max:100',
'billing_address.city' => 'required|string|max:50',
'billing_address.postal_code' => 'required|string|max:10',
'billing_address.country' => 'required|string|size:2',
'payment_terms' => 'nullable|integer|min:1',
'status' => 'nullable|in:active,inactive,prospect',
'notes' => 'nullable|string',
];
}
}