From a5fe0d9d2f2b5c9cdc80b16b1a3293792e35f61e Mon Sep 17 00:00:00 2001 From: Louis Jeckel Date: Wed, 14 Apr 2021 11:48:04 +0200 Subject: [PATCH] email verification --- .idea/lettre-pharma.iml | 2 ++ .idea/php.xml | 2 ++ app/Nova/User.php | 5 ++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.idea/lettre-pharma.iml b/.idea/lettre-pharma.iml index 6df4b51..008fdad 100644 --- a/.idea/lettre-pharma.iml +++ b/.idea/lettre-pharma.iml @@ -86,6 +86,8 @@ + + diff --git a/.idea/php.xml b/.idea/php.xml index 1334ed5..35238ab 100644 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -219,6 +219,8 @@ + + diff --git a/app/Nova/User.php b/app/Nova/User.php index f455fb9..89d673d 100644 --- a/app/Nova/User.php +++ b/app/Nova/User.php @@ -85,7 +85,10 @@ class User extends Resource // ID::make()->sortable(), Text::make('Prénom', 'first_name'), Text::make('Nom', 'last_name'), - Text::make('Email')->required(), + Text::make('Email') + ->rules('required', 'email', 'max:255') + ->creationRules('unique:users,email') + ->updateRules('unique:users,email,{{resourceId}}'), Text::make('Position'), Text::make('Téléphone', 'phone'), -- 2.39.5