How to do remember me function at login option in laravel 5?By Hardik Savani | June 17, 2016 | | 2140 Viewer | Category : Laravel
Share this post:
we always use remember me option in login page, that way user don't require to login everytime. So, we would like use remember me option in our login page then you can also do it simply, because laravel provide it's own functionality. But, many developer can't do it properly i mean remember me not working, but you can implement it right.
First you have to sure that remember_token field in our users table. if you haven't remember_token column then first add it in your users table or any table that you use as for auth.
Now you should have controller method this way:
public function webLoginPost(Request $request)
'email' => 'required|email',
'password' => 'required',
$remember_me = $request->has('remember_me') ? true : false;
if (auth()->attempt(['email' => $request->input('email'), 'password' => $request->input('password')], $remember_me))
$user = auth()->user();
return back()->with('error','your username and password are wrong.');
- AngularJS tooltip using UI Bootstrap tpls HTML example with demo
- Laravel 5 dynamic autocomplete search using select2 JS Ajax - Part 1
- Laravel 5 - How to implement gravatar image using thomaswelton/laravel-gravatar package
- How to import CSV file using mysql
- How to send mail using mailable in laravel 5.3?
- Laravel 5 select with count query with group by example
- How to insert multiple records in Laravel 5?
- Laravel 5 - Full Text Search Example using Scout and Algolia Packages