public function regenerateApiKey(User $user)
    {
        $user->api_key = User::generateApiKey();
        $user->save();

        event(new UserRegeneratedApiTokenEvent($user));

        return cachet_redirect('dashboard.user');
    }
public function regenerateApiKey(User $user)
    {
        $user->api_key = User::generateApiKey();
        $user->save();

        event(new UserRegeneratedApiTokenEvent($user));

        return cachet_redirect('dashboard.user');
    }
public function regenerateApiKey ( User $ user ) { $ user -> api_key = User :: generateApiKey ( ) ; $ user -> save ( ) ; event ( new UserRegeneratedApiTokenEvent ( $ user ) ) ; return cachet_redirect ( 'dashboard.user' ) ; }
Regenerates the users API key.

@param \CachetHQ\Cachet\Models\User $user

@return \Illuminate\View\View
Regenerates the users API key .