input('identifier', $this->input('email')); if ($identifier !== null) { $this->merge([ 'identifier' => strtolower(trim((string) $identifier)), ]); } } public function authorize(): bool { return true; } public function rules(): array { return [ 'identifier' => 'required|string|max:255', 'email' => 'sometimes|nullable|string|max:255', 'password' => 'required|string', ]; } }