geisi/laravel-db-session-helper
A small Laravel helper package for working with database-backed sessions, offering convenience utilities around session storage. Lightweight and easy to drop into existing Laravel apps that use the database session driver.
0.0.x release, pin the version in composer.json and review the changelog before upgrading.isOnline and isOffline query scopes and whatever attribute/accessor determines the current state.$online = YourModel::isOnline()->get();
$offline = YourModel::isOffline()->get();
v0.0.2 before relying on the scopes. This release fixes incorrect scope application and fixes a bug that affected non-SQLite database environments, so MySQL/PostgreSQL users should retest their queries after upgrading.$onlineCount = YourModel::isOnline()->count();
$offlineDevices = YourModel::isOffline()
->where('tenant_id', $tenantId)
->paginate(50);
where, relationships, withCount, and pagination. Verify composition after upgrading, because this release changes how the scopes are applied.$isOnline = YourModel::isOnline()->whereKey($model->getKey())->exists();
Avoid duplicating the online/offline threshold logic in controllers or Blade templates.last_seen_at-style column, schedule the update from a console command or middleware. The online/offline scopes are only as accurate as the data written to that column.return [
'id' => $this->id,
'online' => $this->isOnline(), // or the package’s equivalent accessor
];
Confirm whether the package exposes an attribute/accessor in addition to the scopes; if not, derive it from the same column or method used by the scopes.v0.0.2 fix specifically targets non-SQLite environments, so SQLite-only coverage would not have caught the previous bug.v0.0.2 release fixes a bug in non-SQLite environments. If you are on MySQL, PostgreSQL, or another driver, upgrade and re-run any tests or reports that depend on isOnline/isOffline. If you are on SQLite, still verify scope behavior — the second fix affects scope application generally.isOnline and isOffline “weren’t applied right.” Audit existing queries after upgrading. In particular, check queries that combine the scopes with orWhere, relationship constraints, or global scopes, since scope grouping bugs often surface there.0.0.2, treat the package as early-stage. Pin the exact version, read release notes before updating, and avoid spreading package-specific calls throughout the codebase. Wrap scope usage in repository methods or model query helpers so future API changes are contained.null timestamp may fall into neither scope or into the offline scope depending on the implementation. Decide explicitly whether “never seen” should count as offline in your UI and queries.->toSql() and ->getBindings() before assuming the package is wrong. Also check for global scopes, soft deletes, and tenant scopes that may be interacting with the package scopes.How can I help you explore Laravel packages today?