{"id":19793242,"url":"https://github.com/zguillez/slim-mobile-detect","last_synced_at":"2025-10-07T00:10:26.150Z","repository":{"id":57090548,"uuid":"53426766","full_name":"zguillez/slim-mobile-detect","owner":"zguillez","description":"Implements Mobile-Detect lib for Response's write on Slim Framework App","archived":false,"fork":false,"pushed_at":"2020-12-28T09:33:35.000Z","size":21,"stargazers_count":19,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-01T02:38:48.936Z","etag":null,"topics":["mobile-detect","packagist","php","slim-framework","slimphp"],"latest_commit_sha":null,"homepage":"https://zguillez.io/","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/zguillez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":"zguillez","open_collective":null,"ko_fi":"zguillez","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2016-03-08T16:19:19.000Z","updated_at":"2023-12-19T22:29:01.000Z","dependencies_parsed_at":"2022-08-22T20:40:23.692Z","dependency_job_id":null,"html_url":"https://github.com/zguillez/slim-mobile-detect","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/zguillez/slim-mobile-detect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zguillez%2Fslim-mobile-detect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zguillez%2Fslim-mobile-detect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zguillez%2Fslim-mobile-detect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zguillez%2Fslim-mobile-detect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zguillez","download_url":"https://codeload.github.com/zguillez/slim-mobile-detect/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zguillez%2Fslim-mobile-detect/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278699260,"owners_count":26030493,"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","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["mobile-detect","packagist","php","slim-framework","slimphp"],"created_at":"2024-11-12T07:09:16.522Z","updated_at":"2025-10-07T00:10:26.110Z","avatar_url":"https://github.com/zguillez.png","language":"PHP","funding_links":["https://patreon.com/zguillez","https://ko-fi.com/zguillez","https://ko-fi.com/Q5Q4329UT"],"categories":[],"sub_categories":[],"readme":"# Slim-Mobile-Detect\n\n[![Analytics](https://ga-beacon.appspot.com/UA-1125217-30/zguillez/slim-mobile-detect?pixel)](https://github.com/igrigorik/ga-beacon)\n[![License](http://img.shields.io/:license-mit-blue.svg)](http://doge.mit-license.org)\n[![Installs](https://img.shields.io/npm/dt/slim-mobile-detect.svg)](https://coveralls.io/r/zguillez/slim-mobile-detect)\n[![Join the chat at https://gitter.im/zguillez/slim-mobile-detect](https://badges.gitter.im/zguillez/slim-mobile-detect.svg)](https://gitter.im/zguillez/slim-mobile-detect?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n\u003e [Zguillez](https://zguillez.io) | Guillermo de la Iglesia\n\n[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/Q5Q4329UT)\n\n## Implements [Mobile-Detect](https://github.com/serbanghita/Mobile-Detect) lib for Response's write on [Slim Framework](http://www.slimframework.com/) App\n\n![](https://camo.githubusercontent.com/c76a63e16c7bc3ebf76cb8897d456a6aacc63053/687474703a2f2f64656d6f2e6d6f62696c656465746563742e6e65742f6c6f676f2d6769746875622e706e67)\n\n# Getting Started\n\n### Add package to composer.json\n\n`composer require zguillez/slim-mobile-detect`\n\n\t// composer.json\n\t{\n\t  \"require\": {\n\t    \"slim/slim\": \"^3.0\",\n\t    \"zguillez/slim-mobile-detect\": \"^1.0.0\"\n\t  }\n\t}\n\t\n### Override $request and $response objects on app routes\n\n\t$app-\u003eget('/hello/{name}', function ($request, $response, $args) {\n\t\t$request  = new Slim\\Http\\MobileRequest($request);\n\t\t$response = new Slim\\Http\\MobileResponse($response);\n\t\t\n\t\t// ...\n\t});\n\t\t\n# Usage\n\n### On Request object:\n\n\t$request-\u003eisMobile()\nReturn *true* on **mobile devices** calls\n\n\t$request-\u003eisTablet()\nReturn *true* on mobile **tablet** (no phones) calls\n\n\t$request-\u003eisPhone()\nReturn *true* on mobile **phone** (no tablets) calls\n\n\t$request-\u003eisiOS()\nReturn *true* on mobile with **iOS** calls\n\n\t$request-\u003eisAndroidOS()\nReturn *true* on mobile with **Android** calls\n\n\n### On Response object:\n\n\t$response-\u003ewriteDesktop($data)\nWrite the response only on **desktop** calls\n\n\t$response-\u003ewriteMobile($data)\nWrite the response only on **mobile** calls\n\n\t$response-\u003ewritePhone($data)\nWrite the response only on mobile **phone** (no tablets) calls\n\n\t$response-\u003ewriteTablet($data)\nWrite the response only on **tablet** (no phones) calls\n\n\t$response-\u003ewriteIOS($data)\nWrite the response only on **iOS** calls\n\n\t$response-\u003ewriteAndroid($data)\nWrite the response only on **Android** calls\n\n# Example:\n\n\t\u003c?php\n\t\trequire 'vendor/autoload.php';\n\t\t\n\t\t$app = new Slim\\App();\n\t\t$app-\u003eget('/hello/{name}', function ($request, $response, $args) {\n\t\t\t$request  = new Slim\\Http\\MobileRequest\\MobileRequest($request);\n\t\t\t$response = new Slim\\Http\\MobileResponse\\MobileResponse($response);\n\t\t\tif ($request-\u003eisMobile()) {\n\t\t\t\t//do queries for mobile\n\t\t\t} else {\n\t\t\t\t//do queries for desktop\n\t\t\t}\n\t\t\t$response-\u003ewrite(\"Hello \" . $args['name']);\n\t\t\t$response-\u003ewriteDesktop(\" from desktop\");\n\t\t\t$response-\u003ewriteMobile(\" from mobile\");\n\t\t\t$response-\u003ewritePhone(\" on a phone\");\n\t\t\t$response-\u003ewriteTablet(\" on a tablet\");\n\t\t\t$response-\u003ewriteIOS(\" with iOS\");\n\t\t\t$response-\u003ewriteAndroid(\" with Android\");\n\t\t\treturn $response;\n\t\t});\n\t\t$app-\u003erun();\n\n# Contributing and issues\n\nContributors are welcome, please fork and send pull requests! If you have any ideas on how to make this project better then please submit an issue or send me an [email](mailto:mail@zguillez.io).\n\n# License\n\n©2016 Zguillez.io\n\nOriginal code licensed under [MIT](https://en.wikipedia.org/wiki/MIT_License) Open Source projects used within this project retain their original licenses.\n\n# Changelog\n\n### v1.0.0 (March 8, 2016) \n\n* Initial implementation\n\n[![Analytics](https://ga-beacon.appspot.com/UA-1125217-30/zguillez/slim-mobile-detect?pixel)](https://github.com/igrigorik/ga-beacon)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzguillez%2Fslim-mobile-detect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzguillez%2Fslim-mobile-detect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzguillez%2Fslim-mobile-detect/lists"}