Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creation of dynamic property Config\Validation::$users is deprecated #258

Open
kenjis opened this issue Dec 28, 2022 · 2 comments
Open

Creation of dynamic property Config\Validation::$users is deprecated #258

kenjis opened this issue Dec 28, 2022 · 2 comments

Comments

@kenjis
Copy link
Contributor

kenjis commented Dec 28, 2022

Bonfire2 does not work with PHP 8.2.

@kenjis
Copy link
Contributor Author

kenjis commented Dec 28, 2022

The following patch fixes the errors.
Is the validation rule used actually?

--- a/src/Config/Registrar.php
+++ b/src/Config/Registrar.php
@@ -80,12 +80,12 @@ class Registrar
                 PasswordRules::class,
                 UserRules::class,
             ],
-            'users' => [
-                'email'      => 'required|valid_email|unique_email[{id}]',
-                'username'   => 'required|string|is_unique[users.username,id,{id}]',
-                'first_name' => 'permit_empty|string|min_length[3]',
-                'last_name'  => 'permit_empty|string|min_length[3]',
-            ],
+//            'users' => [
+//                'email'      => 'required|valid_email|unique_email[{id}]',
+//                'username'   => 'required|string|is_unique[users.username,id,{id}]',
+//                'first_name' => 'permit_empty|string|min_length[3]',
+//                'last_name'  => 'permit_empty|string|min_length[3]',
+//            ],
         ];
     }
 

@dgvirtual
Copy link
Contributor

It does seem that these rules are not used; UserController class uses config directly (line 141: $rules = config('Users')->validation;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants