Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel run function after forgot password

*Create Listener in 'AppListeners'

<?php

namespace AppListeners;
use AppPasswordHistory;
use IlluminateAuthEventsPasswordReset;

class ResetPasswordListener
{
    public function handle(PasswordReset $passwordReset)
    {
        $passwordHistory = PasswordHistory::create([
            'user_id' => $passwordReset->user->id,
            'password' => $passwordReset->user->password
        ]);
    }
}

*Add this to $listen in 'AppProvidersEventServiceProvider.php'
  
  'IlluminateAuthEventsPasswordReset' => [
    'AppListenersResetPasswordListener'
  ]
Source by 5balloons.info #
 
PREVIOUS NEXT
Tagged: #laravel #run #function #forgot #password
ADD COMMENT
Topic
Name
9+9 =