i am attempting to make a select, if the select doesn't exist, create it, and either way, add a timestamp 'last_login'
$user = User::find($auth['acc_id']);
if (!$user) {
$user = User::setRawAttributes([
'id' => $auth['acc_id'],
'username' => $auth['username'],
'password' => $auth['password'],
]);
}
$user->last_login = date('Y-m-d H:i:s', time());
I was expecting that to work, but i guess setRawAttributes is not what im looking for? Because i dont want to create a new user and then select it to add the last_login