vendor and env first commit

This commit is contained in:
2025-03-28 08:52:46 +01:00
parent f8388bc81b
commit 8f26283832
10976 changed files with 1349952 additions and 2 deletions
@@ -0,0 +1,31 @@
<?php
namespace Laravel\Fortify\Actions;
use Laravel\Fortify\Events\TwoFactorAuthenticationDisabled;
use Laravel\Fortify\Fortify;
class DisableTwoFactorAuthentication
{
/**
* Disable two factor authentication for the user.
*
* @param mixed $user
* @return void
*/
public function __invoke($user)
{
if (! is_null($user->two_factor_secret) ||
! is_null($user->two_factor_recovery_codes) ||
! is_null($user->two_factor_confirmed_at)) {
$user->forceFill([
'two_factor_secret' => null,
'two_factor_recovery_codes' => null,
] + (Fortify::confirmsTwoFactorAuthentication() ? [
'two_factor_confirmed_at' => null,
] : []))->save();
TwoFactorAuthenticationDisabled::dispatch($user);
}
}
}