1313
1414API wrapper for umami website analytics. get your statistics in the laravel app.
1515
16- check out [ Umami] ( https://umami.is/ ) own your website analytics
16+ check out [ Umami] ( https://umami.is/ ) , own your website analytics
1717
1818## Features
1919
2020- Manage websites
21- - Manage accounts
21+ - Manage users
2222- query statistics stats, page views, events and metrics
2323
2424## Installation
@@ -28,6 +28,12 @@ You can install the package via composer:
2828``` bash
2929composer require still-code/laravel-umami
3030```
31+
32+ #### Umami version:
33+
34+ - for umami v1 use v4
35+ - for umami v2 use v5
36+
3137### Config
3238to publish the configuration file:
3339
@@ -75,7 +81,7 @@ required: site id from umami server
7581
7682required: the stats part you want to get from umami,
7783
78- available options : ` stats, pageviews, events, metrics `
84+ available options : ` active, stats, pageviews, events, metrics`
7985
8086default: ` stats `
8187
@@ -85,7 +91,7 @@ default: `stats`
8591
8692### Options for Query Stats
8793
88- #### Dates (start_at,end_at )
94+ #### Dates (startAt,endAt )
8995
9096optional: Timestamp of starting and end date,
9197
@@ -95,8 +101,8 @@ you can pass `carbon` object or timestamp in milliseconds
95101
96102``` php
97103\Umami\Umami::query(siteID,'metrics',[
98- 'start_at '=>today()->subDays(7),
99- 'end_at '=>today (),
104+ 'startAt '=>today()->subDays(7),
105+ 'endAt '=>now (),
100106]);
101107```
102108
@@ -153,18 +159,29 @@ default: url
153159``` php
154160\Umami\Umami::createWebsite([
155161 'domain'=>'domain.ltd',
156- 'name'=>'account name',
157- 'userId'=>'3', // account id
162+ 'name'=>'user name',
163+ ]);
164+ ```
165+
166+ #### create a website for a diffrent user
167+ if 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.
168+ this is helpfully when creating a new user with a website
169+
170+ ``` php
171+ \Umami\Umami::createWebsite([
172+ 'domain' => 'domain.ltd',
173+ 'name' => 'user name',
174+ ],[
175+ 'username' => 'otherUserName',
176+ 'password' => 'otherPassword',
158177]);
159178```
160179
161180### Update a website
162181
163182``` php
164- \Umami\Umami::websites('d131d2ae-5d21-4a54-80ba-16719afedf7b',[
165- 'domain'=>'domain.ltd',
166- 'name'=>'account name',
167- 'userId'=>'3', // account id
183+ \Umami\Umami::updateWebsites('d131d2ae-5d21-4a54-80ba-16719afedf7b',[
184+ 'name'=>'user name',
168185]);
169186```
170187
@@ -174,33 +191,33 @@ default: url
174191\Umami\Umami::deleteWebsite('d131d2ae-5d21-4a54-80ba-16719afedf7b');
175192```
176193
177- ## Accounts
194+ ## Users
178195
179- ### Get All accounts
196+ ### Get All users
180197
181198``` php
182- \Umami\Umami::accounts ();
199+ \Umami\Umami::users ();
183200```
184201
185- ### Create an account
202+ ### Create a user
186203
187204``` php
188- \Umami\Umami::createAccount ('username','password');
205+ \Umami\Umami::createUser ('username','password');
189206```
190207
191- ### Update an account
208+ ### Update a user
192209
193210``` php
194- \Umami\Umami::updateAccount (1,[
211+ \Umami\Umami::updateUser (1,[
195212 'username'=>'username',
196213 'password'=>'password',
197214]);
198215```
199216
200- ### Delete an account
217+ ### Delete an user
201218
202219``` php
203- \Umami\Umami::deleteAccounts (2);
220+ \Umami\Umami::deleteUser (2);
204221```
205222
206223## More details
0 commit comments