php - Laravel 5 Send Password Reset Link using Ajax -


i have code:

jquery.ajax({     type:"post",     url:"/password/email/",     data:{         _token: jquery("#forgotpasswordcontainer input[name='_token']").val(),         email: email     },     datatype:'json',     beforesend:function(){      },     success:function(data){      },     complete:function(){      } }); 

it seems doing nothing.

when checked firebug, getting html page containing html of /password/email page.

i guessing need modify how sending password reset link works.

can me on matter.

your appreciated!

thanks!

ok, managed solved 1 putting on passwordcontroller.php

public function getemail(request $request) {     $this->validate($request, ['email' => 'required|email']);      $response = $this->passwords->sendresetlink($request->only('email'), function($m)     {         $m->subject($this->getemailsubject());     });      switch ($response)     {         case passwordbroker::reset_link_sent:             return[                 'error'=>'false',                 'msg'=>'a password link has been sent email address'             ];          case passwordbroker::invalid_user:             return[                 'error'=>'true',                 'msg'=>"we can't find user email address"             ];     } } 

i not sure if efficient works me. hope helps someone.

thanks!


Comments