Closed halimkun closed 1 year ago
Hi @halimkun User model's withGroup() method is used when creating new users, not when searching existing users from db.
The UserModel can automatically assign a role during user creation. Pass the group name to the withGroup() method prior to calling insert() or save() to create a new user and the user will be automatically added to that group.
$user = $userModel ->withGroup('guests') ->insert($data);
No answer from author, closing as solved.
hello i am currently using myth auth to build an application that i am making.
I'm having a problem calling the withGroup() function, where my model initialization has been done as follows.
userModel is the default from myth/auth which has been published using spark
but when you want to use the withGroup function it still displays all data outside the group.
roughly looks like the following small part of the model.