user.changeName:before $user, $name /site/config/config.php return [ 'hooks' => [ 'user.changeName:before' => function ($user, $name) { // your code goes here } ] ]