I was wondering if someone could point me in the right direction.
I have just started using laravel 4 and i want to add a login count to my application.
Im using the standard authentication from the laravel docs.
Im guess that i have to add something like the following SQL ... But do i add it from the routes file or the User.php model ... and then how would i call it from the login route?
$sql = "UPDATE some_table SET total_logins = total_logins + 1 WHERE user_id = $userID";
Any help would be awesome
First, instead of sql, i would use Eloquent.
Then, you can access your logged in user with the
Auth::user()function, and use Eloquent increment function :I would do that in your login function in your UserController file.