{"id":16294135,"url":"https://github.com/sarfraznawaz2005/visitlog","last_synced_at":"2025-05-16T10:08:33.490Z","repository":{"id":62540346,"uuid":"68051073","full_name":"sarfraznawaz2005/visitlog","owner":"sarfraznawaz2005","description":":alarm_clock: Laravel package to log visitor information into database.","archived":false,"fork":false,"pushed_at":"2025-02-19T05:24:39.000Z","size":138,"stargazers_count":92,"open_issues_count":4,"forks_count":32,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-19T13:41:40.714Z","etag":null,"topics":["laravel","log","package","php","visitor"],"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/sarfraznawaz2005.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-12T21:49:17.000Z","updated_at":"2025-02-19T05:23:59.000Z","dependencies_parsed_at":"2024-06-18T20:15:45.683Z","dependency_job_id":"767c90cb-eecb-40a2-ac7f-5df78978b491","html_url":"https://github.com/sarfraznawaz2005/visitlog","commit_stats":{"total_commits":71,"total_committers":8,"mean_commits":8.875,"dds":"0.23943661971830987","last_synced_commit":"72b161d69f7cb952bb66fee64f85fa10779007a3"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarfraznawaz2005%2Fvisitlog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarfraznawaz2005%2Fvisitlog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarfraznawaz2005%2Fvisitlog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarfraznawaz2005%2Fvisitlog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sarfraznawaz2005","download_url":"https://codeload.github.com/sarfraznawaz2005/visitlog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254005904,"owners_count":21998341,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["laravel","log","package","php","visitor"],"created_at":"2024-10-10T20:14:18.033Z","updated_at":"2025-05-16T10:08:28.482Z","avatar_url":"https://github.com/sarfraznawaz2005.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel VisitLog\n\n[![Total Downloads](https://poser.pugx.org/sarfraznawaz2005/visitlog/downloads)](https://packagist.org/packages/sarfraznawaz2005/visitlog)\n\n## Introduction ##\n\nVisitLog is a simple Laravel 5 package that can be used to log visitor information and save it into database. \n\n## Features ##\n\n - Other than basic log such as IP, Browser and OS, it can also log Location information.\n - Allows to log both unique and non-unique visits based on IP.\n - Allows to cache the visits based on IP.\n - Allows to log authenticated user info.\n - Provides log viewer page out of box.\n - Provides basic http authentication for app users.\n - Ability to ban users by their IP\n\n\n**Note:** VisitLog cannot detect same user/IP coming from some anonymizer so it cannot differentiate that.\n\n## Screenshot ##\n\n![Main Window](https://raw.github.com/sarfraznawaz2005/visitlog/master/screen.png)\n\n*Note: Info in above screenshot is fake.*\n\n## Requirements ##\n\n - PHP \u003e= 5.5.9\n - Laravel 5\n\n## Installation ##\n\nInstall via composer\n```\ncomposer require sarfraznawaz2005/visitlog\n```\n\nFor Laravel \u003c 5.5:\n\nAdd Service Provider to `config/app.php` in `providers` section\n```php\nSarfraznawaz2005\\VisitLog\\VisitLogServiceProvider::class,\n```\n\nAdd Facade to `config/app.php` in `aliases` section\n```php\n'VisitLog' =\u003e Sarfraznawaz2005\\VisitLog\\Facades\\VisitLog::class,\n```\n\n---\n\nRun `php artisan vendor:publish` to publish package's config and migration file. You should now have `config/visitlog.php` file published. It will also publish migration file in `database/migrations` folder.\n\nRun `php artisan migrate` to create `visitlogs` table in your database.\n\n## Config Options ##\n\n - `route` : Route where visit log will be available.\n - `iptolocation` : By default, only IP, Browser and OS info is logged. However if you set this option to `true`, it will also log Location info through  https://ipstack.com/ service. Note: You will need to create account there and get your access key and specify that in visitlog config file.\n - `cache` : If `iptolocation` is set to `true`, this option can be used to cache the results instead of requesting Location info each time from https://ipstack.com/. \n - `unique` : If `true`, it will only log unique visits based on IP address. If `false`, it will log each visit even from same IP.\n - `log_user` : If `true`, it will also log authenticated user info.\n - `user_name_fields` : If `log_user` is `true`, this option can be used to specify name fields of user from your Users table in database.\n - `visitlog_page` : If `true`, a default log viewer page can be viewed at `http//yourapp.com/your_route` to see all the logs. Here `your_route` is the first option above.\n - `http_authentication` : If `visitlog_page` is `true`, this option can be used to show visit log page to only authenticated app users by asking them email and password via basic http authentication.\n\n## Saving Log Info ##\n\nTo save logs, just call `save` method of `VisitLog` facade:\n`VisitLog::save();`\n\n**Tip:** If you want to save only unique logs based on IP, login or post-login page is good place to use the `save` method on because generally login page isn't visited again after user is authenticated. If you also want to save authenticated user, calling `save` method inside login post method seems to be good idea.\n\nIf however, you have set `unique` option to `false` and want to log all visits, calling `save` method in common location is good idea like base controller of your app.\n\n## Viewing Log Info ##\n\nIf config option `visitlog_page` is set to `true`, you can view all visit logs by browsing to `http//yourapp.com/your_route`.\n\n**Note:** If you don't want to allow `visitlog` page to be publicly seen, set the option `visitlog_page` to `false` and now `http//yourapp.com/your_route` will result in `404` error.\n\nIn this case, you can still show log info in some authenticated area of your app by using `all` method of `VisitLog` facade: `$visitLogs = VisitLog::all();` and it will give you `Collection` that you can iterate over and show in your own view file.\n\n\n## Credits\n\n- [Sarfraz Ahmed][link-author]\n- [All Contributors][link-contributors]\n\n## License ##\n\nThis code is published under the [MIT License](http://opensource.org/licenses/MIT).\nThis means you can do almost anything with it, as long as the copyright notice and the accompanying license file is left intact.\n\n[link-author]: https://github.com/sarfraznawaz2005\n[link-contributors]: https://github.com/sarfraznawaz2005/visitlog/graphs/contributors\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarfraznawaz2005%2Fvisitlog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsarfraznawaz2005%2Fvisitlog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarfraznawaz2005%2Fvisitlog/lists"}