{"id":25952398,"url":"https://github.com/still-code/laravel-umami","last_synced_at":"2025-03-04T14:50:56.876Z","repository":{"id":41875415,"uuid":"413043529","full_name":"still-code/laravel-umami","owner":"still-code","description":"API wrapper for umami website analytics. get your stats in the laravel app","archived":false,"fork":false,"pushed_at":"2024-03-26T02:59:17.000Z","size":174,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-03-26T03:44:45.701Z","etag":null,"topics":[],"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/still-code.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","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},"funding":{"github":"atmonshi"}},"created_at":"2021-10-03T10:21:15.000Z","updated_at":"2024-04-15T08:45:37.109Z","dependencies_parsed_at":"2024-01-01T08:45:17.629Z","dependency_job_id":"558ec620-6dba-4721-ab62-4ccf54c618d5","html_url":"https://github.com/still-code/laravel-umami","commit_stats":{"total_commits":66,"total_committers":4,"mean_commits":16.5,"dds":"0.31818181818181823","last_synced_commit":"aa3210206bf005d064b8804d06670a5a626756e1"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/still-code%2Flaravel-umami","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/still-code%2Flaravel-umami/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/still-code%2Flaravel-umami/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/still-code%2Flaravel-umami/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/still-code","download_url":"https://codeload.github.com/still-code/laravel-umami/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241868475,"owners_count":20033822,"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":[],"created_at":"2025-03-04T14:50:56.234Z","updated_at":"2025-03-04T14:50:56.864Z","avatar_url":"https://github.com/still-code.png","language":"PHP","funding_links":["https://github.com/sponsors/atmonshi"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"https://banners.beyondco.de/Laravel%20Umami.png?theme=light\u0026packageManager=composer+require\u0026packageName=still-code%2Flaravel-umami\u0026pattern=brickWall\u0026style=style_1\u0026description=Umami+API+wrapper+for+laravel\u0026md=1\u0026showWatermark=1\u0026fontSize=125px\u0026images=chart-bar\" width=\"600\"\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/umami-software/umami\"\u003e\u003cimg src=\"https://img.shields.io/github/package-json/v/umami-software/umami?color=white\u0026logoColor=white\u0026label=Umami\u0026logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAACXBIWXMAAD2EAAA9hAHVrK90AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm%2B48GgAACHVJREFUeJztnW9slVcdxz%2FnuaXl9nbWu39dppWlmW3JYk2k4htKbGsTkgEZOhY0VdRkyvQFBmFKzLSYmJnwwvhnBodxAbQhkYTI0khc1ipgX0ykSLewFqw0sauDwq6UCt3u7c8X52l3e3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F91%2FqnQLxH%2BdK%2B7LX5d9LRopdR96CeK9tu7N4wBq0VkLNcH5p2OICLXgWe9zmoZ8635zADm77LSuq4jhN%2FUl3oc9XIlhwr0N%2Fj6BT9sycYg8EnJ48Uwec2gEpFb6AVUbi8yseXIBPDZfMyAAqa0iUg%2F8HV087PkhwBPi8gb%2Be9R%2BBJ%2Fewi%2FP14q8WzB%2Bha6g2vKfgMO1vR4vihtizREAYcMOGhT40Xc21KBGOKaEgF%2BacDBmxYvApGidS12xzRjvmOACKbEjxet52ILcE35Clle5rKMIgl8zRMtvSjENaUNve5T2OIEHW8DbZ7p6FVBrikPAn8yQKSgoht42FMNvSzMNSUC%2FBDdjMMWzK94D%2Fge4Hiun9cFphnTCLxmgHhex2vo%2B1L%2B6OZXwa4pCv3i%2BmsGCLnYuI5ear3oS9rQDUkz5gHg52R5k9sSiNvAz4B7A9EqiEoyjOlAT98KW%2BiFYhz4KXrcbWAaBfqC%2B2ncR8PfRH9%2FeSTwBOZnGL0w6Asikgi68lAMmZWAUmvQ55kvAPeHlEYCeBk4DLwqIYoSuiHTKKVWol%2F53Qo0o8eE%2BbUE4RTQD%2FSg5%2Fa9IiKTPtVVEMYYkolS6n70K10%2FAdS58ShQVmBRk%2Bi3pg0Al9CXrX8RPYDDOIw1JBvuiMpH0HcEKtDvM7nH%2FRn02l%2Fj6AV1bgH%2FAYZFD%2FxbEiwpQ5YDdplYw7CGGIY1xDD%2BD5eOJyTdi6OvAAAAAElFTkSuQmCC\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/still-code/laravel-umami\"\u003e\u003cimg src=\"https://img.shields.io/packagist/v/still-code/laravel-umami\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/still-code/laravel-umami\"\u003e\u003cimg src=\"https://img.shields.io/packagist/dt/still-code/laravel-umami\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/still-code/laravel-umami\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/still-code/laravel-umami\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/still-code/laravel-umami/actions?query=workflow%3AFix+PHP+code+style+issues+branch%3Amain\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/still-code/laravel-umami/fix-php-code-style-issues.yml?branch=main\u0026label=code%20style\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/still-code/laravel-umami/actions/workflows/fix-php-code-style-issues.yml\"\u003e\u003cimg src=\"https://github.com/still-code/laravel-umami/actions/workflows/fix-php-code-style-issues.yml/badge.svg\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# Umami API wrapper for laravel\n\nAPI wrapper for umami website analytics. get your statistics in the laravel app.\n\ncheck out [Umami](https://umami.is/), own your website analytics\n\n## Features\n\n- Manage websites\n- Manage users\n- query statistics stats, page views, events and metrics\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require still-code/laravel-umami\n```\n\n#### Umami version:\n\n- for umami v1 use v4\n- for umami v2 use v5\n\n### Config\nto publish the configuration file:\n\n```bash\nphp artisan vendor:publish --provider=\"Umami\\UmamiServiceProvider\"\n```\n\nand then add these to your `.env` file:\n\n```bash\nUMAMI_URL=https://stats-site-com/api\nUMAMI_USERNAME=username\nUMAMI_PASSWORD=\"password\"\nUMAMI_WEBSITE_ID=d131d2ae-5d21-4a54-80ba-16719afedf7b\n```\n\n## Usage\n\n### Query Stats\n```php\n\\Umami\\Umami::query('example-site-id', 'metrics', [\n    'start_at'=\u003etoday()-\u003esubDays(7),\n    'end_at'=\u003etoday(),\n    'type'=\u003e'referrer',\n]);\n```\n\n\u003cbr\u003e\n\nshort usage for `PHP 8` to get default stats for the last 7 days and without cache:\n```php\n\\Umami\\Umami::query(siteID: 1, force: true)\n```\n\n### Parameters\n\n#### Site id\n\nrequired: site id from umami server\n\n```php\n\\Umami\\Umami::query('example-site-id');\n```\n\n#### Part\n\nrequired: the stats part you want to get from umami,\n\navailable options : `active, stats, pageviews, events, metrics`\n\ndefault: `stats`\n\n```php\n\\Umami\\Umami::query('example-site-id','pageviews');\n```\n\n### Options for Query Stats\n\n#### Dates (start_at,end_at)\n\noptional: Timestamp of starting and end date,\n\ndefault: last 7 days\n\nyou can pass `carbon` object or timestamp in milliseconds\n\n```php\n\\Umami\\Umami::query('example-site-id','metrics',[\n    'start_at'=\u003etoday()-\u003esubDays(7),\n    'end_at'=\u003enow(),\n]);\n```\n\n##### unit\nonly available on `pageviews` and `events`\n\noptional: Time unit, available options: `year, month, hour, day`,\n\ndefault: day\n\n```php\n\\Umami\\Umami::query('example-site-id','metrics',[\n    'unit'=\u003e'year',\n]);\n```\n\n##### Timezone (tz)\noptional: Timezone,\n\nonly available on `pageviews` and `events`\n\ndefault: config('app.timezone')\n\n```php\n\\Umami\\Umami::query('example-site-id','metrics',[\n    'tz'=\u003e'America/Los_Angeles',\n]);\n```\n\n##### type (for metrics only)\n\noptional: Gets metrics for a given time range,\n\navailable options: `url, referrer, browser, os, device, country, event`,\n\ndefault: url\n\n```php\n\\Umami\\Umami::query('example-site-id','metrics',[\n    'tz'=\u003e'America/Los_Angeles',\n]);\n```\n\n## Websites\n\n### Get All websites\n\n```php\n\\Umami\\Umami::websites();\n```\n\n### Create a website\n\n```php\n\\Umami\\Umami::createWebsite([\n    'domain'=\u003e'domain.ltd',\n    'name'=\u003e'user name',\n]);\n```\n\n#### create a website for a diffrent user\nIf you want to create a website for different user then the admin user defined in the config, you need to provide the authentication for that user.\nthis is helpful when creating a new user with a website\n\n```php\n\\Umami\\Umami::createWebsite([\n    'domain' =\u003e 'domain.ltd',\n    'name' =\u003e 'user name',\n],[\n    'username' =\u003e 'otherUserName',\n    'password' =\u003e 'otherPassword',\n]);\n```\n\n### Update a website\n\n```php\n\\Umami\\Umami::updateWebsites('example-site-id',[\n    'name'=\u003e'user name',\n]);\n```\n\n### Delete a website\n\n```php\n\\Umami\\Umami::deleteWebsite('example-site-id');\n```\n\n## Event data\n\n### Get website event and field key record counts within a given time range\n\nSee the API documentation for details: https://umami.is/docs/api/event-data#get-/api/event-data/events\n\n```php\n\\Umami\\Umami::events('example-site-id', [\n    'start_at'=\u003etoday()-\u003esubDays(7),\n    'end_at'=\u003enow(),\n    'event' =\u003e 'custom_event',\n]);\n```\n\n### Get website field key and value record counts within a given time range\n\nSee the API documentation for details: https://umami.is/docs/api/event-data#get-/api/event-data/fields\n\n```php\n\\Umami\\Umami::event_fields('example-site-id', [\n    'start_at'=\u003etoday()-\u003esubDays(7),\n    'end_at'=\u003enow(),\n]);\n```\n\n## Users\n\n### Get all users\n\n```php\n\\Umami\\Umami::users();\n```\n\n### Create a user\n\n```php\n\\Umami\\Umami::createUser('username','password');\n```\n\n### Update a user\n\n```php\n\\Umami\\Umami::updateUser(1,[\n    'username'=\u003e'username',\n    'password'=\u003e'password',\n]);\n```\n\n### Delete a user\n\n```php\n\\Umami\\Umami::deleteUser(2);\n```\n\n## More details\n\nPlease check out [Umami website](https://umami.is/) for more information.\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Credits\n\n- [Mike Cao](https://github.com/mikecao)\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%2Fstill-code%2Flaravel-umami","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstill-code%2Flaravel-umami","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstill-code%2Flaravel-umami/lists"}