Skip to content

Commit 2c98161

Browse files
committed
Merge branch 'merge-main-fix' into refactor-service-provider
2 parents 99bdd1d + bd1149c commit 2c98161

20 files changed

Lines changed: 308 additions & 121 deletions

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@
22

33
All notable changes to `laravel-request-analytics` will be documented in this file.
44

5+
## v1.4.1 - 2025-09-20
6+
7+
### What's Changed
8+
9+
* fix: place view all button at the bottom by @me-shaon in https://github.com/me-shaon/laravel-request-analytics/pull/55
10+
11+
**Full Changelog**: https://github.com/me-shaon/laravel-request-analytics/compare/v1.4.0...v1.4.1
12+
13+
## v1.4.0 - 2025-09-20
14+
15+
### What's Changed
16+
17+
* remove: drop DNT header support and configuration by @theihasan in https://github.com/me-shaon/laravel-request-analytics/pull/47
18+
* Updated README banner with a fresh image by @alnahian2003 in https://github.com/me-shaon/laravel-request-analytics/pull/53
19+
* Add view all modal functionality to analytics components by @theihasan in https://github.com/me-shaon/laravel-request-analytics/pull/54
20+
21+
**Full Changelog**: https://github.com/me-shaon/laravel-request-analytics/compare/v1.3.1...v1.4.0
22+
523
## v1.3.1 - 2025-09-17
624

725
### What's Changed

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/me-shaon/laravel-request-analytics/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/me-shaon/laravel-request-analytics/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
66
[![Total Downloads](https://img.shields.io/packagist/dt/me-shaon/laravel-request-analytics.svg?style=flat-square)](https://packagist.org/packages/me-shaon/laravel-request-analytics)
77

8-
![Laravel request analytics](https://github.com/me-shaon/laravel-request-analytics/blob/main/preview.png?raw=true)
8+
![Laravel request analytics](https://github.com/me-shaon/laravel-request-analytics/blob/main/banner_preview.png?raw=true)
99

1010
## Overview
1111

@@ -126,7 +126,6 @@ return [
126126

127127
'privacy' => [
128128
'anonymize_ip' => env('REQUEST_ANALYTICS_ANONYMIZE_IP', false),
129-
'respect_dnt' => env('REQUEST_ANALYTICS_RESPECT_DNT', true), // Respect Do Not Track header
130129
],
131130

132131
'cache' => [
@@ -210,7 +209,6 @@ protected function schedule(Schedule $schedule): void
210209
### Privacy & Compliance
211210
- **GDPR Compliance**: Built-in privacy controls and data anonymization
212211
- **IP Anonymization**: Configurable IP address masking for user privacy
213-
- **Do Not Track Support**: Respects browser DNT headers automatically
214212
- **Data Retention**: Configurable automatic data pruning and cleanup
215213

216214
### Intelligence & Detection
@@ -312,12 +310,10 @@ The package supports multiple geolocation providers:
312310
```php
313311
'privacy' => [
314312
'anonymize_ip' => env('REQUEST_ANALYTICS_ANONYMIZE_IP', false),
315-
'respect_dnt' => env('REQUEST_ANALYTICS_RESPECT_DNT', true),
316313
]
317314
```
318315

319316
- **IP Anonymization**: Masks the last octet of IPv4 addresses (192.168.1.xxx)
320-
- **Do Not Track**: Automatically respects browser DNT headers
321317

322318
### Bot Detection
323319

@@ -552,6 +548,7 @@ Please review [our security policy](../../security/policy) on how to report secu
552548
- [Ahmed shamim](https://github.com/me-shaon)
553549
- [Omar Faruque](https://github.com/OmarFaruk-0x01)
554550
- [Md Abul Hassan](https://github.com/imabulhasan99)
551+
- [Al Nahian](https://github.com/alnahian2003)
555552
- [All Contributors](../../contributors)
556553

557554
## License

banner_preview.png

540 KB
Loading

config/request-analytics.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161

6262
'privacy' => [
6363
'anonymize_ip' => env('REQUEST_ANALYTICS_ANONYMIZE_IP', false),
64-
'respect_dnt' => env('REQUEST_ANALYTICS_RESPECT_DNT', true), // Respect Do Not Track header
6564
],
6665

6766
'cache' => [
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
public function up()
10+
{
11+
$tableName = config('request-analytics.database.table', 'request_analytics');
12+
$connection = config('request-analytics.database.connection');
13+
14+
if (! Schema::connection($connection)->hasTable($tableName)) {
15+
Schema::connection($connection)->create($tableName, function (Blueprint $table) {
16+
$table->id();
17+
$table->string('path');
18+
$table->string('page_title')->nullable();
19+
$table->string('ip_address');
20+
$table->string('operating_system')->nullable();
21+
$table->string('browser')->nullable();
22+
$table->string('device')->nullable();
23+
$table->string('screen')->nullable();
24+
$table->string('referrer')->nullable();
25+
$table->string('country')->nullable();
26+
$table->string('city')->nullable();
27+
$table->string('language')->nullable();
28+
$table->text('query_params')->nullable();
29+
$table->string('session_id');
30+
$table->string('visitor_id')->nullable();
31+
$table->unsignedBigInteger('user_id')->nullable();
32+
$table->string('http_method');
33+
$table->string('request_category');
34+
$table->bigInteger('response_time')->nullable();
35+
$table->timestamp('visited_at');
36+
});
37+
}
38+
}
39+
40+
public function down()
41+
{
42+
$tableName = config('request-analytics.database.table', 'request_analytics');
43+
$connection = config('request-analytics.database.connection');
44+
45+
Schema::connection($connection)->dropIfExists($tableName);
46+
}
47+
};

database/migrations/create_request_analytics_table.php.stub

Lines changed: 0 additions & 45 deletions
This file was deleted.

preview.png

-2.33 MB
Binary file not shown.

resources/views/components/analytics/broswers.blade.php

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@props([
22
'browsers' => [],
3+
'allBrowsers' => null,
34
])
45

56
@php
@@ -14,10 +15,30 @@ function getBrowserImage($browser): string {
1415
};
1516
}
1617
}
18+
19+
$displayBrowsers = array_slice($browsers, 0, 5);
20+
$allBrowsersData = $allBrowsers ?? $browsers;
21+
$hasMore = count($allBrowsersData) > 5;
22+
23+
$modalItems = collect($allBrowsersData)->map(function($browser) {
24+
return [
25+
'label' => $browser['browser'],
26+
'count' => $browser['count'],
27+
'percentage' => $browser['percentage'],
28+
'imgSrc' => getBrowserImage($browser['browser'])
29+
];
30+
})->toArray();
1731
@endphp
1832

19-
<x-request-analytics::stats.list primaryLabel="Browser" secondaryLabel="">
20-
@forelse($browsers as $browser)
33+
<x-request-analytics::stats.list
34+
primaryLabel="Browser"
35+
secondaryLabel=""
36+
:showViewAll="$hasMore"
37+
modalTitle="All Browsers"
38+
:allItems="$modalItems"
39+
modalId="browsers-modal"
40+
>
41+
@forelse($displayBrowsers as $browser)
2142
<x-request-analytics::stats.item
2243
label="{{ $browser['browser'] }}"
2344
count="{{ $browser['count'] }}"

resources/views/components/analytics/countries.blade.php

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,32 @@
11
@props([
22
'countries' => [],
3+
'allCountries' => null,
34
])
45

6+
@php
7+
$displayCountries = array_slice($countries, 0, 5);
8+
$allCountriesData = $allCountries ?? $countries;
9+
$hasMore = count($allCountriesData) > 5;
10+
11+
$modalItems = collect($allCountriesData)->map(function($country) {
12+
return [
13+
'label' => $country['name'],
14+
'count' => $country['count'],
15+
'percentage' => $country['percentage'],
16+
'imgSrc' => "https://www.worldatlas.com/r/w236/img/flag/{$country['code']}-flag.jpg"
17+
];
18+
})->toArray();
19+
@endphp
520

6-
<x-request-analytics::stats.list primaryLabel="Countries" secondaryLabel="">
7-
@forelse($countries as $country)
21+
<x-request-analytics::stats.list
22+
primaryLabel="Countries"
23+
secondaryLabel=""
24+
:showViewAll="$hasMore"
25+
modalTitle="All Countries"
26+
:allItems="$modalItems"
27+
modalId="countries-modal"
28+
>
29+
@forelse($displayCountries as $country)
830
<x-request-analytics::stats.item
931
label="{{ $country['name'] }}"
1032
count="{{ $country['count'] }}"

resources/views/components/analytics/devices.blade.php

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@props([
22
'devices' => [],
3+
'allDevices' => null,
34
])
45

56
@php
@@ -14,9 +15,30 @@ function getDeviceImage($device): string {
1415
};
1516
}
1617
}
18+
19+
$displayDevices = array_slice($devices, 0, 5);
20+
$allDevicesData = $allDevices ?? $devices;
21+
$hasMore = count($allDevicesData) > 5;
22+
23+
$modalItems = collect($allDevicesData)->map(function($device) {
24+
return [
25+
'label' => $device['name'],
26+
'count' => $device['count'],
27+
'percentage' => $device['percentage'],
28+
'imgSrc' => getDeviceImage($device['name'])
29+
];
30+
})->toArray();
1731
@endphp
18-
<x-request-analytics::stats.list primaryLabel="Devices" secondaryLabel="">
19-
@forelse($devices as $device)
32+
33+
<x-request-analytics::stats.list
34+
primaryLabel="Devices"
35+
secondaryLabel=""
36+
:showViewAll="$hasMore"
37+
modalTitle="All Devices"
38+
:allItems="$modalItems"
39+
modalId="devices-modal"
40+
>
41+
@forelse($displayDevices as $device)
2042
<x-request-analytics::stats.item
2143
label="{{ $device['name'] }}"
2244
count="{{ $device['count'] }}"

0 commit comments

Comments
 (0)