diff --git a/app/Extensions/Illuminate/Database/Eloquent/Builder.php b/app/Extensions/Illuminate/Database/Eloquent/Builder.php deleted file mode 100644 index 2a093985e..000000000 --- a/app/Extensions/Illuminate/Database/Eloquent/Builder.php +++ /dev/null @@ -1,16 +0,0 @@ -setRememberToken(Str::random(60)); $user->save(); - $this->dispatcher->dispatch(new PasswordReset($user)); + event(new PasswordReset($user)); // If the user is not using 2FA log them in, otherwise skip this step and force a // fresh login where they'll be prompted to enter a token. diff --git a/app/Http/Middleware/VerifyReCaptcha.php b/app/Http/Middleware/VerifyReCaptcha.php index d3bc5a338..762a9646d 100644 --- a/app/Http/Middleware/VerifyReCaptcha.php +++ b/app/Http/Middleware/VerifyReCaptcha.php @@ -6,18 +6,10 @@ use GuzzleHttp\Client; use Illuminate\Http\Request; use Illuminate\Http\Response; use App\Events\Auth\FailedCaptcha; -use Illuminate\Contracts\Events\Dispatcher; use Symfony\Component\HttpKernel\Exception\HttpException; class VerifyReCaptcha { - /** - * VerifyReCaptcha constructor. - */ - public function __construct(private Dispatcher $dispatcher) - { - } - /** * Handle an incoming request. */ @@ -45,12 +37,7 @@ class VerifyReCaptcha } } - $this->dispatcher->dispatch( - new FailedCaptcha( - $request->ip(), - !empty($result) ? ($result->hostname ?? null) : null - ) - ); + event(new FailedCaptcha($request->ip(), $result->hostname ?? null)); throw new HttpException(Response::HTTP_BAD_REQUEST, 'Failed to validate reCAPTCHA data.'); } diff --git a/app/Listeners/Auth/AuthenticationListener.php b/app/Listeners/Auth/AuthenticationListener.php index de5271901..01a8e35c0 100644 --- a/app/Listeners/Auth/AuthenticationListener.php +++ b/app/Listeners/Auth/AuthenticationListener.php @@ -5,10 +5,9 @@ namespace App\Listeners\Auth; use App\Facades\Activity; use Illuminate\Auth\Events\Failed; use App\Events\Auth\DirectLogin; -use Illuminate\Contracts\Events\Dispatcher; -use App\Extensions\Illuminate\Events\Contracts\SubscribesToEvents; +use Illuminate\Events\Dispatcher; -class AuthenticationListener implements SubscribesToEvents +class AuthenticationListener { /** * Handles an authentication event by logging the user and information about