Skip to content

Commit e74a6fe

Browse files
authored
Release 5.0 (#202)
2 parents 640b01f + 15768ae commit e74a6fe

32 files changed

+2226
-2195
lines changed

.github/workflows/latest.yml

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,22 @@
1-
name: Latest
1+
name: "Test on Latest Laravel"
22

33
# Triggers the workflow on push or pull request events
44
on: [push, pull_request]
55

66
jobs:
7-
matrix-build:
7+
test:
8+
name: PHPUnit Tests
89
runs-on: ubuntu-latest
910

10-
strategy:
11-
fail-fast: true
12-
matrix:
13-
php-version: [8.1]
14-
laravel-version: [9.39.0]
15-
1611
steps:
17-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v3
1813

1914
- name: Setup PHP
2015
uses: shivammathur/setup-php@master
2116
with:
22-
php-version: ${{ matrix.php-version }}
17+
php-version: 8.2
2318

24-
- name: Composer update
19+
- name: Composer self update
2520
run: composer self-update >/dev/null 2>&1
2621

2722
- name: Get composer cache directory
@@ -37,8 +32,8 @@ jobs:
3732

3833
- name: Lock laravel/framework version
3934
env:
40-
LARAVEL_VERSION: ${{ matrix.laravel-version }}
41-
run: composer require laravel/framework:${{ matrix.laravel-version }} --no-update
35+
LARAVEL_VERSION: 10.5.0
36+
run: composer require laravel/framework:10.5.0 --no-update
4237

4338
- name: Vendor update
4439
if: steps.composer-cache.outputs.cache-hit != 'true'
@@ -47,12 +42,6 @@ jobs:
4742
- name: Run test suites
4843
run: composer run-script test
4944

50-
- name: Analyze
51-
run: vendor/bin/phpstan analyse -c phpstan.neon ./src/
52-
53-
# - name: phpcs
54-
# run: php vendor/bin/phpcs --standard=PSR12 ./src/
55-
5645
- name: Coveralls
5746
env:
5847
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test-php7.yml

Lines changed: 0 additions & 79 deletions
This file was deleted.
Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,30 @@
1-
name: PHP8.1
1+
name: PHP8.2
22

33
# Manual run
44
on: workflow_dispatch
55

66
jobs:
77
matrix-build:
8+
name: PHPUnit Tests Matrix
89
runs-on: ubuntu-latest
910

1011
strategy:
1112
fail-fast: false
1213
matrix:
13-
php-version: [8.1]
14+
php-version: [8.2]
1415
# these versions supports php8 in their composer.json
1516
laravel-version:
1617
[
17-
9.0,
18-
9.1,
19-
9.2,
20-
9.3,
21-
9.4,
22-
9.5,
23-
9.6,
24-
9.7,
25-
9.8,
18+
9.52,
19+
10.0,
20+
10.1,
21+
10.2,
22+
10.3,
23+
10.4,
2624
]
2725

2826
steps:
29-
- uses: actions/checkout@v2
27+
- uses: actions/checkout@v3
3028

3129
- name: Setup PHP
3230
uses: shivammathur/setup-php@master
@@ -47,8 +45,8 @@ jobs:
4745
- name: Run test suites
4846
run: composer run-script test
4947

50-
- name: Analyze
51-
run: vendor/bin/phpstan analyse -c phpstan.neon ./src/
48+
# - name: Analyze
49+
# run: vendor/bin/phpstan analyse -c phpstan.neon ./src/
5250

5351
# - name: phpcs
5452
# run: php vendor/bin/phpcs --standard=PSR12 ./src/

.github/workflows/test-php8.yml

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

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ vendor
33
.vscode
44
demo/cache
55
.phpunit.result.cache
6-
.DS_store
6+
.DS_store
7+
.phpunit.cache

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
### Changes in 5.0.0
2+
3+
---
4+
5+
- Support for Laravel 10.x
6+
- Upgrade to MobileDetect 3.x
7+
- Remove the outdated "mobileGrade" feature
8+
- Test on PHP 8.2 too
9+
110
### Changes in 4.5.2
211

312
---

Procfile

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![Browser Detection Logo](https://user-images.githubusercontent.com/3441017/126362397-d9767164-4f44-4d41-a3cd-b669e10e95dc.png)
22

3-
## Browser Detection v4.5 by _[hisorange](https://hisorange.me)_
3+
## Browser Detection v5.0 by _[hisorange](https://hisorange.me)_
44

55
[![Latest Stable Version](https://poser.pugx.org/hisorange/browser-detect/v/stable)](https://packagist.org/packages/hisorange/browser-detect)
66
[![Build](https://github.com/hisorange/browser-detect/actions/workflows/latest.yml/badge.svg?branch=stable)](https://github.com/hisorange/browser-detect/actions/workflows/latest.yml)
@@ -10,7 +10,9 @@
1010

1111
Easy to use package to identify the visitor's browser details and device type.
1212
Magic is **not** involved the results are generated by multiple well tested and developed packages.
13-
Supporting **every laravel** version between **4.0 » 9.0**, also tested on **every PHP** version between **5.6 » 8.1**.
13+
14+
Supports **every Laravel** version between **4.0 » 10.x**;
15+
Also tested on **every PHP** version between **5.6 » 8.2**.
1416

1517
### How to install
1618

@@ -32,10 +34,14 @@ In Your code just call the **Browser** facade:
3234
use Browser;
3335

3436
// Determine the user's device type is simple as this:
35-
Browser::isMobile();
37+
$isMobile = Browser::isMobile();
3638
Browser::isTablet();
3739
Browser::isDesktop();
3840

41+
if (Browser::isMobile()) {
42+
// Redirect to the mobile version of the site.
43+
}
44+
3945
// Every wondered if it is a bot who loading Your page?
4046
if (Browser::isBot()) {
4147
echo 'No need to wonder anymore!';
@@ -85,15 +91,16 @@ Easy peasy, ain't it?
8591

8692
The following matrix is has been continuously tested by the great and awesome **GitHub Actions**!
8793

88-
| ----- | Browser Detect 1.x | Browser Detect 2.x | Browser Detect 3.x | Browser Detect 4.x |
89-
| :---------: | :----------------: | :----------------: | :----------------: | :----------------: |
90-
| Laravel 4.x | ✓ | ✓ | - | - |
91-
| Laravel 5.x | - | ✓ | ✓ | - |
92-
| Laravel 6.x | - | - | - | ✓ |
93-
| Laravel 7.x | - | - | - | ✓ |
94-
| Laravel 8.x | - | - | - | 4.4+ |
95-
| Laravel 9.x | - | - | - | 4.4+ |
96-
| Standalone | - | - | - | 4.2+ |
94+
| ----- | Browser Detect 1.x | Browser Detect 2.x | Browser Detect 3.x | Browser Detect 4.x | Browser Detect 5.x |
95+
| :----------: | :----------------: | :----------------: | :----------------: | :----------------: | :----------------: |
96+
| Laravel 4.x | ✓ | ✓ | - | - | - |
97+
| Laravel 5.x | - | ✓ | ✓ | - | - |
98+
| Laravel 6.x | - | - | - | ✓ | - |
99+
| Laravel 7.x | - | - | - | ✓ | - |
100+
| Laravel 8.x | - | - | - | 4.4+ | - |
101+
| Laravel 9.x | - | - | - | 4.4+ | ✓ |
102+
| Laravel 10.x | - | - | - | - | ✓ |
103+
| Standalone | - | - | - | 4.2+ | ✓ |
97104

98105
Since 2013 the package runs tests on every possible PHP / Laravel version matrix.
99106

@@ -149,7 +156,6 @@ Every call on the **Browser** facade is proxied to a result object, so the follo
149156
| **Device related functions** | | |
150157
| Browser::deviceFamily() | Device's vendor like Samsung, Apple, Huawei. | _(string)_ |
151158
| Browser::deviceModel() | Device's brand name like iPad, iPhone, Nexus. | _(string)_ |
152-
| Browser::mobileGrade() | Device's mobile grade in scale of A,B,C for performance. | _(string)_ |
153159
| **Browser vendor related functions** | | |
154160
| Browser::isChrome() | Is this a chrome browser. | _(boolean)_ |
155161
| Browser::isFirefox() | Is this a firefox browser. | _(boolean)_ |
@@ -211,21 +217,6 @@ And it will use the application's cache to persist the result for a week or so,
211217
this should provide You with a sufficient caching mechanism so the detection will
212218
cost less than **0.02 millisecond**, this was tested with an 80,000 fake visit.
213219

214-
### Community
215-
216-
---
217-
218-
At the time of this writing, the library is getting closer to be 7 years old. I have implemented
219-
every user request which was feasible, and running out of ideas for the future. By this statement
220-
I am declaring this as the last feature release at version 4.2, from now on I will maintain compatibility
221-
with new Laravel and PHP versions, but not planning to do any new features.
222-
223-
Thank You for your support over the years, and worry not, the library is stable, and has all the features You ever need.
224-
225-
~ Update on this :D
226-
227-
No major features are added in the past months, but with the help of [Raymund Ács](https://github.com/PoOwAa) we are patching and continuing the support for micro features and version ports.
228-
229220
### Changelog
230221

231222
---

0 commit comments

Comments
 (0)