Fix upsert contact request and contact model type hint in accordance with DB constrains

This commit is contained in:
Jérémy Munsch 2023-08-29 10:07:36 +02:00
parent 98a80bee98
commit b2e73f2ef2
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC
2 changed files with 5 additions and 5 deletions

View file

@ -67,11 +67,11 @@ class UpsertContactsRequest extends FormRequest
'contacts' => 'present|array',
'contacts.*' => 'array',
'contacts.*.id' => 'nullable|uuid|exists:contacts,id',
'contacts.*.name' => 'required|string|max:255',
'contacts.*.lastname' => 'required|string|max:255',
'contacts.*.firstname' => 'required|string|max:255',
// * Dot not validate email here (soft validate), if it does not pass, app will be blocked.
'contacts.*.email' => 'required|string|max:255',
'contacts.*.phone' => 'required|string|max:255',
'contacts.*.phone' => 'nullable|string|max:255',
// * DATA
'contacts.*.data' => 'present|array',

View file

@ -17,10 +17,10 @@ use Kwaadpepper\Enum\Traits\CastsEnums;
* @property string $email
* @property string $lastname
* @property string $firstname
* @property string $phone
* @property string|null $phone
* @property array<\App\Lib\Inputs\Definition\Input> $data
* @property string $notes
* @property array<array<string,string>> $visits
* @property string|null $notes
* @property array<array<string,string>>|null $visits
*/
class Contact extends Model
{