{"id":38593497,"url":"https://github.com/y0usefalsaadany/visits-package","last_synced_at":"2026-01-17T08:25:54.696Z","repository":{"id":41196246,"uuid":"508283882","full_name":"y0usefalsaadany/visits-package","owner":"y0usefalsaadany","description":"Its job is to deal with site views it will give you the number of views of the IP of the person who visited the site, his city, the page he visited and the type of his operating system, and you will also block him temporarily if he makes more than 6 requests per minute on one page","archived":false,"fork":false,"pushed_at":"2022-07-04T12:59:12.000Z","size":30,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-07-31T09:50:32.100Z","etag":null,"topics":["laravel","middleware","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/y0usefalsaadany.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-28T12:10:40.000Z","updated_at":"2024-06-12T16:58:57.000Z","dependencies_parsed_at":"2022-08-10T01:43:07.048Z","dependency_job_id":null,"html_url":"https://github.com/y0usefalsaadany/visits-package","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/y0usefalsaadany/visits-package","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y0usefalsaadany%2Fvisits-package","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y0usefalsaadany%2Fvisits-package/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y0usefalsaadany%2Fvisits-package/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y0usefalsaadany%2Fvisits-package/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/y0usefalsaadany","download_url":"https://codeload.github.com/y0usefalsaadany/visits-package/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/y0usefalsaadany%2Fvisits-package/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28504364,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T06:57:29.758Z","status":"ssl_error","status_checked_at":"2026-01-17T06:56:03.931Z","response_time":85,"last_error":"SSL_read: 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":["laravel","middleware","php"],"created_at":"2026-01-17T08:25:54.620Z","updated_at":"2026-01-17T08:25:54.681Z","avatar_url":"https://github.com/y0usefalsaadany.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# install package\n\n```\ncomposer require yousefpackage/visits\n```\n\n# then goto config folder \n\nin app.php\n\nwrite this in $routeMiddleware\n\n```\n'providers' =\u003e [\n\nYousefpackage\\Visits\\VisitServiceProvider::class,\nYousefpackage\\Visits\\RoutePackageServiceProvider::class,\n\n],\n```\n\n# then goto kernel.php\n\nwrite this in $routeMiddleware\n\n```\n'visit' =\u003e \\Yousefpackage\\Visits\\Http\\Middleware\\VistsMiddleware::class,\n```\n\n# then run this command \n\n```\nphp artisan migrate\n```\n\n# test package \n\nnow for test this package goto your browser and write this visits-package\n\n```\nhttp://127.0.0.1:8000/visits-package\n```\n\n# using\nNow Put this middleware on the route you want to calculate the number of views for.\n\n```\n-\u003emiddleware('throttle:visit', 'visit');\n```\n\nlike this \n\n```\nRoute::get('/', function () {\n    return view('welcome');\n})-\u003emiddleware('throttle:visit', 'visit');\n```\n\nIf you want to calculate the number of views you have, make a controller and then put this code\n\n```\n\u003c?php\n\nuse Yousefpackage\\Visits\\Models\\Visit;\nuse Illuminate\\Support\\Facades\\DB;\n\nclass ViewsController extends Controller\n{\n    function index(){\n\n        return DB::table('visits')-\u003eselect('ip')-\u003ecount(); // To count the number of views \n\n        return Visit::all(); // To display the data in the visits table\n    }\n}\n\n\u003e\n```\n\nAnd we find in the table that we have the visitor’s IP, his city, the page he visited and the type of his operating system\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fy0usefalsaadany%2Fvisits-package","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fy0usefalsaadany%2Fvisits-package","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fy0usefalsaadany%2Fvisits-package/lists"}