src/Controllers/Auth/PasswordController.php
public function postRequest(Request $request)
    {
        // Validate the form data
        $result = $this->validate($request, [
            'email' => 'required|email|max:255'
        ]);

        // Fetch the user in question
        $user = Sentinel::findUserByCredentials(['email' => $request->get('email')]);

        // Only send them an email if they have a valid, inactive account
        if ($user) {
            // Generate a new code
            $reminder = Reminder::create($user);

            // Send the email
            $code = $reminder->code;
            $email = $user->email;
            Mail::to($email)->queue(new CentaurPasswordReset($code));
        }

        $message = 'Instructions for changing your password will be sent to your email address if it is associated with a valid account.';

        if ($request->expectsJson()) {
            return response()->json(['message' => $message, 'code' => $code], 200);
        }

        Session::flash('success', $message);
        return redirect()->route('dashboard');
    }
public function postRequest(Request $request)
    {
        // Validate the form data
        $result = $this->validate($request, [
            'email' => 'required|email|max:255'
        ]);

        // Fetch the user in question
        $user = Sentinel::findUserByCredentials(['email' => $request->get('email')]);

        // Only send them an email if they have a valid, inactive account
        if ($user) {
            // Generate a new code
            $reminder = Reminder::create($user);

            // Send the email
            $code = $reminder->code;
            $email = $user->email;
            Mail::to($email)->queue(new CentaurPasswordReset($code));
        }

        $message = 'Instructions for changing your password will be sent to your email address if it is associated with a valid account.';

        if ($request->expectsJson()) {
            return response()->json(['message' => $message, 'code' => $code], 200);
        }

        Session::flash('success', $message);
        return redirect()->route('dashboard');
    }
public function postRequest ( Request $ request ) { // Validate the form data $ result = $ this -> validate ( $ request , [ 'email' => 'required|email|max:255' ] ) ; // Fetch the user in question $ user = Sentinel :: findUserByCredentials ( [ 'email' => $ request -> get ( 'email' ) ] ) ; // Only send them an email if they have a valid, inactive account if ( $ user ) { // Generate a new code $ reminder = Reminder :: create ( $ user ) ; // Send the email $ code = $ reminder -> code ; $ email = $ user -> email ; Mail :: to ( $ email ) -> queue ( new CentaurPasswordReset ( $ code ) ) ; } $ message = 'Instructions for changing your password will be sent to your email address if it is associated with a valid account.' ; if ( $ request -> expectsJson ( ) ) { return response ( ) -> json ( [ 'message' => $ message , 'code' => $ code ] , 200 ) ; } Session :: flash ( 'success' , $ message ) ; return redirect ( ) -> route ( 'dashboard' ) ; }
Send a password reset link
@return Response|Redirect
Send a password reset link