For an existing application, storing the last login date of a user as a integer based timestamp, I would need to develop a custom laravel based module.
The data field itself named "last_visit" is storing these integer based timestamps, like: 1534501831.
On my model I already included the last_visit as a date property:
protected $dates = [
'last_visit',
];
Now when I do this inside my controller (only debug):
$users = User::where('last_visit', '<', Carbon::now()->subMonths(1))->->orderBy('last_visit', 'desc')->get();
echo "<html><body>";
foreach ($users as $user) {
echo $user->name . " " . $user->last_visit . "</br>";
}
echo "</body></html>";
I get this result:
userX 1970-01-01 00:00:00
How to make sure laravel is able to parse the correct timestamp, so I can do my query above.