I have a table like this:
User (user_id, count)
Now I want to insert a user id to this table, then update count = count + 1. How I can do this in eloquent?
I tried:
protected $table = 'user';
public function insertAndUpdateCount($user_id)
{
return $this->insert($user_id)
->increment('count', 1);
}
But it's seem not working.