Skip to content

Commit

Permalink
Update dependencies and add cache for device detection
Browse files Browse the repository at this point in the history
  • Loading branch information
MoamenEltouny committed Mar 23, 2024
1 parent f7ddb52 commit 50a9ef1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"require": {
"php": ">=7.2",
"laravel/framework": ">=6.0",
"matomo/device-detector": ">=4.3.0"
"matomo/device-detector": ">=6.0.5"
},
"config": {
"sort-packages": true
Expand Down
2 changes: 2 additions & 0 deletions src/Classes/AgentDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Pharaonic\Laravel\Agents\Classes;

use DeviceDetector\Cache\LaravelCache;
use DeviceDetector\DeviceDetector;
use DeviceDetector\Parser\Client\Browser as ClientBrowser;
use DeviceDetector\Parser\Device\AbstractDeviceParser;
Expand Down Expand Up @@ -135,6 +136,7 @@ public function load(Agent $agent = null)
// Device Detection
AbstractDeviceParser::setVersionTruncation(AbstractDeviceParser::VERSION_TRUNCATION_NONE);
$newAgent = new DeviceDetector($this->agent);
$newAgent->setCache(new LaravelCache());
$newAgent->parse();

// Collect data
Expand Down

0 comments on commit 50a9ef1

Please sign in to comment.