Add contact_name, contact_email, phone, website columns. Wire the new fields through the Organisation model, update request validation, response resource, and the TypeScript Organisation interface. Needed by the upcoming dashboard + form-builder binding registry. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
39 lines
1.3 KiB
PHP
39 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Requests\Api\V1;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
final class UpdateOrganisationRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/** @return array<string, mixed> */
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'name' => ['sometimes', 'string', 'max:255'],
|
|
'slug' => [
|
|
'sometimes', 'string', 'max:255', 'regex:/^[a-z0-9-]+$/',
|
|
Rule::unique('organisations', 'slug')->ignore($this->route('organisation')),
|
|
],
|
|
'contact_name' => ['sometimes', 'nullable', 'string', 'max:255'],
|
|
'contact_email' => ['sometimes', 'nullable', 'email', 'max:255'],
|
|
'phone' => ['sometimes', 'nullable', 'string', 'max:255'],
|
|
'website' => ['sometimes', 'nullable', 'url', 'max:255'],
|
|
'settings' => ['sometimes', 'array'],
|
|
'email_logo_url' => ['nullable', 'url', 'max:500'],
|
|
'email_primary_color' => ['nullable', 'string', 'regex:/^#[0-9A-Fa-f]{6}$/'],
|
|
'email_reply_to' => ['nullable', 'email'],
|
|
'email_sender_name' => ['nullable', 'string', 'max:100'],
|
|
'email_footer_text' => ['nullable', 'string', 'max:2000'],
|
|
];
|
|
}
|
|
}
|