php - Call to Controller from a href returns nothing (Laravel 5) -
i have logout users site. have in view:
<a href="{{ url::route('up_sessions.destroy') }}">logout</a>
in routes.php heve this:
route::resource('up_sessions','sessionscontroller');
the destroy method sessionscontroller
session()->put('key', null);
and @ end return redirect::to('home');
when click on 'logout' send me localhost:8000/up_sessions/%7bup_sessions%7d , nothing happens. expecting return 'home' , need, click on logout, go controller, call destroy method, unset sessions keys , go home. don't understand why link has last segment %7bup_sessions%7d ...i don't have route , don't know how rid of it. anyway, need click on logout , logout good.
what doing wrong ?
to point route desire controller method use this
<a href="{{ action('sessionscontroller@destroy') }}">logout</a>
Comments
Post a Comment