I am using a change password functionality in my Laravel 5 Application after the Admin has logged in. I am using the default form provided by laravel for change password functionality which redirects to /userpasswords/email, When the user click on the "Send Password Reset Link". A mail is sent on the mail id but I want to change this url. My url becomes http://localhost/bqs_test/public/index.php/password/reset/1f488a5daf26b57af2d928bb9c0b14e627b34c3459d819f471d402c42f476bf2 which is sent on the email id but I want it to be as http://localhost/bqs_test/public/index.php/userpasswords/reset/1f488a5daf26b57af2d928bb9c0b14e627b34c3459d819f471d402c42f476bf2. How can I do this, I am new to Laravel, so please someone help. My code is as:
<?php echo Form::open(array('url' => '/userpasswords/email', 'method' => 'post','class'=>'form-horizontal')); ?>
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<div class="form-group">
<label class="col-md-4 control-label">E-Mail Address</label>
<div class="col-md-6">
<input type="email" class="form-control" name="email" value="{{ Auth::user()->email }}" readonly>
</div>
</div>
<div class="form-group">
<div class="col-md-6 col-md-offset-4">
<button type="submit" class="btn btn-primary">
Send Password Reset Link
</button>
</div>
</div>
The route defined as:
Route::controllers([
'auth' => 'Auth\AuthController',
'password' => 'Auth\PasswordController',
'userpasswords' => 'Auth\UserPasswordController'
]);
The UserPasswordController is same as PasswordController but it uses a different trait ResetPasswords which is same as ResetsPasswords with slight change. My postEmail method in ResetPasswords is like:
public function postEmail(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 redirect()->back()->with('status', trans($response));
case PasswordBroker::INVALID_USER:
return redirect()->back()->withErrors(['email' => trans($response)]);
}
}
Someone please help how can I change the Url.