{"id":36995976,"url":"https://github.com/geisi/laravel-db-session-helper","last_synced_at":"2026-01-13T23:48:19.727Z","repository":{"id":48320230,"uuid":"391665090","full_name":"geisi/laravel-db-session-helper","owner":"geisi","description":"This package is build on top of the Laravel session database driver. With it you are able to query users by their login state.","archived":false,"fork":false,"pushed_at":"2021-08-01T19:02:22.000Z","size":30,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-25T11:07:25.154Z","etag":null,"topics":["database","driver","eloquent","laravel","laravel-framework","laravel-jetstream","login","offline","online","query","session","state","user"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/geisi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null},"funding":{"github":"geisi"}},"created_at":"2021-08-01T15:28:22.000Z","updated_at":"2022-04-02T17:00:44.000Z","dependencies_parsed_at":"2022-08-19T13:20:46.522Z","dependency_job_id":null,"html_url":"https://github.com/geisi/laravel-db-session-helper","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/geisi/laravel-db-session-helper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geisi%2Flaravel-db-session-helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geisi%2Flaravel-db-session-helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geisi%2Flaravel-db-session-helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geisi%2Flaravel-db-session-helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geisi","download_url":"https://codeload.github.com/geisi/laravel-db-session-helper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geisi%2Flaravel-db-session-helper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28405384,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","driver","eloquent","laravel","laravel-framework","laravel-jetstream","login","offline","online","query","session","state","user"],"created_at":"2026-01-13T23:48:19.654Z","updated_at":"2026-01-13T23:48:19.718Z","avatar_url":"https://github.com/geisi.png","language":"PHP","funding_links":["https://github.com/sponsors/geisi"],"categories":[],"sub_categories":[],"readme":"⚠️ Laravel DB Session Helper is under development - use at your own risk.\n# Laravel helper package for the database session driver\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/geisi/laravel-db-session-helper.svg?style=flat-square)](https://packagist.org/packages/geisi/laravel-db-session-helper)\n[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/geisi/laravel-db-session-helper/run-tests?label=tests)](https://github.com/geisi/laravel-db-session-helper/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/geisi/laravel-db-session-helper/Check%20\u0026%20fix%20styling?label=code%20style)](https://github.com/geisi/laravel-db-session-helper/actions?query=workflow%3A\"Check+%26+fix+styling\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/geisi/laravel-db-session-helper.svg?style=flat-square)](https://packagist.org/packages/geisi/laravel-db-session-helper)\n\nThis package adds some niceties when using the database session driver in Laravel Projects. Its main purpose is to be\nable to filter users by their online state.\n\nIt integrates well with Laravel Jetstream applications.\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require geisi/laravel-db-session-helper\n```\n\nFirst add HasDatabaseSessions trait to your User model(s):\n\n```php\n//User.php\nuse Illuminate\\Foundation\\Auth\\User as Authenticatable;\nuse Geisi\\LaravelDbSessionHelper\\Traits\\HasDatabaseSessions\n\nclass User extends Authenticatable\n{\n    use HasDatabaseSessions;\n    \n    // ...\n}\n```\n\nYou can publish the config file with:\n```bash\nphp artisan vendor:publish --provider=\"Geisi\\LaravelDbSessionHelper\\LaravelDbSessionHelperServiceProvider\"\n```\n\n## Usage\n\n```php\n//Query all online users\n\\App\\Models\\User::isOnline()-\u003eget();\n//Query all offline users\n\\App\\Models\\User::isOffline()-\u003eget();\n//Get user online state\nvar_dump($user-\u003eis_online);\n// true or false\n//Get user last login date\nvar_dump($user-\u003elast_login);\n// Carbon instance\n```\n\n## Requirements\n\nTo be able to run this package you need Laravel \u003e= 8.42.x and PHP =\u003e 7.4 or PHP 8.0. In order to query the users session\ndata the database session driver is needed.\n\n## Configuration\n\nBy default the time span to determine if a user is online or offline is 10 minutes. So if a user does not interact with\nyour application within 10 minutes he is gonna be queried as offline.\n\nYou can change this timespan with the login_time_span configuration value.\n\nYou can extend or replace our Session model with your own. The only necessary thing to do is to implement the\nGeisi\\LaravelDbSessionHelper\\Contracts\\Session contract interface.\n\n## Beta\n\nThis package is currently in Beta state. As we cannot guarantee 100% stability and feature safety we don't recommend using this package in production.\nPlease submit possible bugs under issues.\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n- [Tim Geisendörfer](https://github.com/geisi)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeisi%2Flaravel-db-session-helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeisi%2Flaravel-db-session-helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeisi%2Flaravel-db-session-helper/lists"}