Shield custom field |
Hello,
in codeigniter 4. I'm using the codeigniter shield authorization and login system. I'm trying, following the official guide, to insert a custom user field. there is probably some step that wasn't clear to me or that I didn't perform correctly, because when I register a new user, the new custom field is not stored in the user table. here my code. the custom field name are "cellulare" I'm sure I'm missing a step, but I can't figure out which one. Thanks to everyone who will help me understand the problem. migration: PHP Code: <?php (12-22-2023, 06:39 PM)kenjis Wrote: This step?Yes, i followed this step. i have named the field: cellulare is the only field. i have insert my usermodel. it is wrong?
My question was that did you do update the $userProvider in app/Config/Auth.php?
https://github.com/codeigniter4/shield/b...-usermodel If you did it, I don't know what's wrong with you. (12-25-2023, 05:03 PM)kenjis Wrote: My question was that did you do update the $userProvider in app/Config/Auth.php?dho! yes, but in the wrong way... I followed the guide step by step. I then called the Model, UserModel.php when I came to edit the auth.php file I noticed that the directive was present: public string $userProvider = UserModel::class; I assumed that php spark not only created the UserMode.php file, but also put it in $UserProvider. After reading your answer, I changed the variable to: public string $userProvider = \App\Models\UserModel::class; by entering the full path to the file created by php spark now it works perfectly. Thank you!
Okay, good!
The official documentation has been updated: https://shield.codeigniter.com/customiza..._provider/ |
Welcome Guest, Not a member yet? Register Sign In |