Generates "remember me" authentication key
public generateAuthKey ( ) |
$user = new User(); $user->generateAuthKey();
$user = User::find(1); $user->generateAuthKey();This example retrieves an existing User object with an ID of 1 and generates a new authentication key for it using the generateAuthKey() method. This method is commonly found in PHP frameworks such as Yii2 and Laravel, which provide common models for user authentication and authorization. The common.models namespace is typically used to store these common models.