Laravel 5.1 有这个代码:
public function postEmail(Request $request)
{
$this->validate($request, ['email' => 'required|email']);
$response = Password::sendResetLink($request->only('email'), function (Message $message) {
$message->subject($this->getEmailSubject());
});
switch ($response) {
case Password::RESET_LINK_SENT:
return redirect()->back()->with('status', trans($response));/*I HAVE TO CHANGE THIS*/
case Password::INVALID_USER:
return redirect()->back()->withErrors(['email' => trans($response)]);
}
}
该代码来自一个特征: app\vendor\laravel\framework\src\Illuminate\Foundation\Auth\ResetsPasswords.php
我需要用另一个代码更改带有注释的行:
return redirect()->route('login')->with(['message' => 'Se ha enviado a su email el link del reseteo, por favor verifique.',]);
但它是一个供应商文件。我怎样才能做到这一点?覆盖另一个文件中的方法?在哪里?
手掌心
慕虎7371278