0
Hey, guys, what’s up? I’m sending an email to the customer like this:
@component('mail::button', ['url' => env('APP_URL') .'/SobeDocsFiadorCadastrado/'. $fiador->id ])
Clique para iniciar
@endcomponent
However, the system obviously asks for the login credentials and after passing them, I need the user to be directed to the route that is on the button, but instead, he goes home.
Here’s the piece of Logincontroller’s code that takes care of it:
public function login(Request $request)
{
$credentials = $this->credentials($request);
$login = $credentials[$this->username()];
$cpfCnpjHigienizado = str_replace('-', '', str_replace('/', '', (str_replace('.', '', $request->cpfCnpj))));
$credenciais = User::where('cpfCnpj', '=', $cpfCnpjHigienizado)->first();
if ($credenciais) { // Se já estiver cadastro, vai pra home
Auth::login($credenciais);
return redirect(route('SobeDocsFiador'))->withFiador($request->fiador);
// return redirect(route('home'));
} else {
//////////////////////////////////////////////////////// INICIO LOGIN NOS WS
-> a partir desse ponto, sei que o não é cadastrado e vai fazer outra coisa
Anyway, how do I redirect to the URL I send by email?
I’ve tried a return $request->all();
to see what returns after login ,but stop $fiador->id
won’t come...
Very good indeed Allan, thank you! But it is not by scrolling that I want to redirect, but by route, for example: I sent an email to the user to go to the route 'Sobedocsfiador'. Only first he has to log in and then be redirected to this route. Only he won’t... he goes home
– Marcello Patto