0

This is my ResetPasswordController

<?php

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use App\Notifications\PasswordUpdate;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\ResetsPasswords;
use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Facades\Auth;

class ResetPasswordController extends Controller
{

    use Notifiable;


    public function notifyAbout()
    {
        $user = Auth::user();
        $user->notify(new PasswordUpdate());
    }

    /*
    |--------------------------------------------------------------------------
    | Password Reset Controller
    |--------------------------------------------------------------------------
    |
    | This controller is responsible for handling password reset requests
    | and uses a simple trait to include this behavior. You're free to
    | explore this trait and override any methods you wish to tweak.
    |
    */

    use ResetsPasswords;



    /**
     * Where to redirect users after resetting their password.
     *
     * @var string
     */



    protected $redirectTo = RouteServiceProvider::HOME;






}
All paths are right, I checked, and the notification was created by php artisan make:notification so the problem is not with the wrong notification.
I ve set up all things but I still can't get email if I changed pass. Someone?
goose
  • 64
  • 5

1 Answers1

2

If you want a notification if a user Resets his password, you can hook into the PasswordReset event.

Here is another answer I wrote, that tells you a bit about events and listeners.

Add action during login process

In your case you would need this in EventServiceProvider

// include at the top
use Illuminate\Auth\Events\PasswordReset;

protected $listen = [
        // other handlers [],
    PasswordReset::class => [
        CreateUserApiToken::class,
    ],
];
wschopohl
  • 1,567
  • 1
  • 11
  • 18