What is the right way to pass variables to the Create Laravel page

0

I'm doing my TCC and I have a pre-registration page, where information of type [nome, email, senha, token] and it saves in the pre_register table. Then a email is sent to the person with a link, it contains the following:

  

It contains, after user, email in md5 , and after the / has token and this is sent to controller UserController@createPreUser , method is this:

public function createPreUser($mail, $token)
{
    $register = PreRegister::where('register_token', $token)->first();
    return redirect()->action('UserController@create', compact('register'));
}

It sends to another create method:

public function create(Request $r)
{
     $user = PreRegister::find($r->register);
     return view('user.register', compact('user'));
}

This view has the rest of the registration, to fill the information like this, I just sent to this create method because it leaves the URL like this:

  

link

If I send in the other method, it would be a giant URL with email and token I know I'm doing the wrong things because it's ugly.

  • What can I improve?
  • Can you send this data to View by POST , so that it does not appear in the URL?
asked by anonymous 29.08.2017 / 01:14

0 answers