dimanche 3 juillet 2016

Ho to set the right URL in Laravel

I'm trying to go to a specific URL based on the User's id. When I'm on the home page I can see user's email as well as user's id just fine by doing this:

                  <div class="panel-body">
                    Hola <strong></strong><br/> Welcome!
                    // tester@gmail.com
                       // 15
                </div>

But after clicking on this Link:

           <a href="">Edit User</a>

I would like to go to: http://localhost:8000/editar-cuenta/15

However for some reason whenever I click on the link I get this link:

                  http://localhost:8000/editar-cuenta/Auth::user()-%3Eid

Can anyone tell me what I'm doing wrong please?

Here's my routes.php

 Route::get('editar-cuenta/{id}', 'HomeController@edit');

Here's my HomeController:

public function edit($id)
{
    $students = Student::where("id", $id)->first();
    return view('editar-cuenta', compact('students'));
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire