Skip to content

Commit

Permalink
Change the place where this is called.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ferks-FK authored and IceToast committed Sep 16, 2023
1 parent 441d897 commit 7967065
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion app/Listeners/Verified.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ public function __construct()
*/
public function handle($event)
{
if (! $event->user->email_verified_reward) {
if (!$event->user->email_verified_reward) {
$event->user->increment('server_limit', config('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL'));
$event->user->increment('credits', config('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_EMAIL'));
$event->user->update(['email_verified_reward' => true]);
}
}
}
3 changes: 1 addition & 2 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,7 @@ public function verifyEmail()
public function reVerifyEmail()
{
$this->forceFill([
'email_verified_at' => null,
'email_verified_reward' => true,
'email_verified_at' => null
])->save();
}

Expand Down
7 changes: 4 additions & 3 deletions app/Providers/EventServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
use App\Listeners\CreateInvoice;
use App\Listeners\UnsuspendServers;
use App\Listeners\UserPayment;
use App\Listeners\Verified;
use App\Listeners\Verified as VerifiedListener;
use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use SocialiteProviders\Manager\SocialiteWasCalled;
use Illuminate\Auth\Events\Verified;

class EventServiceProvider extends ServiceProvider
{
Expand All @@ -35,8 +36,8 @@ class EventServiceProvider extends ServiceProvider
// ... other providers
'SocialiteProviders\\Discord\\DiscordExtendSocialite@handle',
],
'Illuminate\Auth\Events\Verified' => [
Verified::class,
Verified::class => [
VerifiedListener::class,
],
];

Expand Down

0 comments on commit 7967065

Please sign in to comment.