joshrainwater / active-users

A Laravel Package for easily retrieving a list of active users and guests that are currently online.
MIT License
89 stars 32 forks source link

set the keyType in the session model to string. #5

Closed Holonist closed 4 years ago

Holonist commented 4 years ago

First of all thanks for this simple yet great package.

However I was pulling my hair out the last two days on why I cannot properly retrieve the session id from the models.

By default, Laravel casts all primaryKey fields to int, which destroys the actual session id that is a string. Instead, the model needs protected $keyType = 'string'

I committed the necessary line.

joshrainwater commented 4 years ago

Thanks for the contribution... this package probably deserves a little more love but I just haven't managed to find the time!