Code Monkey home page Code Monkey logo

browser-detect's Introduction

Browser Detection Logo

Browser Detection v5.0 by hisorange

Latest Stable Version Build Coverage Status Total Downloads License

Easy to use package to identify the visitor's browser details and device type. Magic is not involved the results are generated by multiple well tested and developed packages.

Supports every Laravel version between 4.0 » 10.x; Also tested on every PHP version between 5.6 » 8.2.

How to install


composer require hisorange/browser-detect

Yep, it's ready to be used by You! ^.^

How to use


In Your code just call the Browser facade:

use Browser;

// Determine the user's device type is simple as this:
$isMobile = Browser::isMobile();
Browser::isTablet();
Browser::isDesktop();

if (Browser::isMobile()) {
  // Redirect to the mobile version of the site.
}

// Every wondered if it is a bot who loading Your page?
if (Browser::isBot()) {
    echo 'No need to wonder anymore!';
}

// Check for common vendors.
if (Browser::isFirefox() || Browser::isOpera()) {
    $response .= '<script src="firefox-fix.js"></script>';
}

// Sometimes You may want to serve different content based on the OS.
if (Browser::isAndroid()) {
    $response .= '<a>Install our Android App!</a>';
} elseif (Browser::isMac() && Browser::isMobile()) {
    $response .= '<a>Install our iOS App!</a>';
}

Even in Your blade templates:

@mobile
    <p>This is the MOBILE template!</p>
    @include('your-mobile-template')
@endmobile

@tablet
    <p>This is the TABLET template!</p>
    <link rel="stylesheet" href="tablet.css" title="Reduce the page size, load what the user need">
@endtablet

@desktop
    <p>This is the DESKTOP template!</p>
@enddesktop

{-- Every result key is supported --}
@browser('isBot')
    <p>Bots are identified too :)</p>
@endbrowser

Easy peasy, ain't it?

Version support


The following matrix has been continuously tested by the great and awesome GitHub Actions!

----- Browser Detect 1.x Browser Detect 2.x Browser Detect 3.x Browser Detect 4.x Browser Detect 5.x
Laravel 4.x - - -
Laravel 5.x - - -
Laravel 6.x - - - -
Laravel 7.x - - - -
Laravel 8.x - - - 4.4+ -
Laravel 9.x - - - 4.4+
Laravel 10.x - - - -
Standalone - - - 4.2+

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

Standalone mode, without Laravel!


Based on community requests; Now You can use the library without Laravel. Just simply use the Parser class as a static object.

use hisorange\BrowserDetect\Parser as Browser;

if (Browser::isLinux()) {
    // Works as well!
}

Available API calls


Every call on the Browser facade is proxied to a result object, so the following information are available on Your result too, where You can use the [array] syntax to access them.

Call Response Internal Type
Browser::userAgent() Current visitor's HTTP_USER_AGENT string. (string)
Browser::isMobile() Is this a mobile device. (boolean)
Browser::isTablet() Is this a tablet device. (boolean)
Browser::isDesktop() Is this a desktop computer. (boolean)
Browser::isBot() Is this a crawler / bot. (boolean)
Browser::deviceType() Enumerated response for [Mobile, Tablet, Desktop, and Bot] (string)
Browser related functions
Browser::browserName() Browser's human friendly name like Firefox 3.6, Chrome 42. (string)
Browser::browserFamily() Browser's vendor like Chrome, Firefox, Opera. (string)
Browser::browserVersion() Browser's human friendly version string. (string)
Browser::browserVersionMajor() Browser's semantic major version. (integer)
Browser::browserVersionMinor() Browser's semantic minor version. (integer)
Browser::browserVersionPatch() Browser's semantic patch version. (integer)
Browser::browserEngine() Browser's engine like: Blink, WebKit, Gecko. (string)
Operating system related functions
Browser::platformName() Operating system's human friendly name like Windows XP, Mac 10. (string)
Browser::platformFamily() Operating system's vendor like Linux, Windows, Mac. (string)
Browser::platformVersion() Operating system's human friendly version like XP, Vista, 10. (integer)
Browser::platformVersionMajor() Operating system's semantic major version. (integer)
Browser::platformVersionMinor() Operating system's semantic minor version. (integer)
Browser::platformVersionPatch() Operating system's semantic patch version. (integer)
Operating system extended functions
Browser::isWindows() Is this a windows operating system. (boolean)
Browser::isLinux() Is this a linux based operating system. (boolean)
Browser::isMac() Is this an iOS or Mac based operating system. (boolean)
Browser::isAndroid() Is this an Android operating system. (boolean)
Device related functions
Browser::deviceFamily() Device's vendor like Samsung, Apple, Huawei. (string)
Browser::deviceModel() Device's brand name like iPad, iPhone, Nexus. (string)
Browser vendor related functions
Browser::isChrome() Is this a chrome browser. (boolean)
Browser::isFirefox() Is this a firefox browser. (boolean)
Browser::isOpera() Is this an opera browser. (boolean)
Browser::isSafari() Is this a safari browser. (boolean)
Browser::isIE() Checks if the browser is an some kind of Internet Explorer (or Trident) (boolean)
Browser::isIEVersion() Compares to a given IE version (boolean)
Browser::isEdge() Is this a microsoft edge browser. (boolean)
Miscellaneous
Browser::isInApp() Check for browsers rendered inside applications like android webview. (boolean)

Configuration, personalization


If You are using Laravel then after installation run the following command:

# Will copy a config file to ~/app/config/browser-detect.php
php artisan vendor:publish

For standalone mode to apply Your custom configuration:

use hisorange\BrowserDetect\Parser;

$browser = new Parser(null, null, [
    'cache' => [
        'interval' => 86400 // This will override the default configuration.
    ]
]);

$result = $browser->detect();

Since the package aims to be easy to use, there is not much to configure. But You can customize the cache and security values.

Advanced Usage Information


The code is designed to be an easy to use style, so every call You make on the Browser facade will access the result object and get the data for You, but You can parse agents other than the current user's.

// When You call the detect function You will get a result object, from the current user's agent.
$result = Browser::detect();

// If You wanna get browser details from a user agent other than the current user call the parse function.
$result = Browser::parse('Opera/9.80 (Windows NT 6.0) Presto/2.12.388 Version/12.14');

Worthy notion! The parser only parsing each user agent string once and then caches it, it uses an in-memory runtime cache for multiple calls in a single page load; And it will use the application's cache to persist the result for a week or so, this should provide You with a sufficient caching mechanism so the detection will cost less than 0.02 millisecond, this was tested with an 80,000 fake visit.

Changelog


See the detailed changes in the CHANGELOG file.

browser-detect's People

Contributors

antonioanerao avatar apiaget avatar dependabot[bot] avatar emnsen avatar hisorange avatar ipitchkhadze avatar irazasyed avatar khaledsmq avatar lahaxearnaud avatar larvacent avatar lukevers avatar martijnimhoff avatar matthewnessworthy avatar matzekitt avatar mrothauer avatar mylesduncanking avatar ovdsteen avatar poowaa avatar potsky avatar rhynodesigns avatar rogervila avatar shelob9 avatar shiroamada avatar stokic avatar sudogetbeer avatar xico2k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

browser-detect's Issues

Not able to find the windows phone

Hi ,
I am happy to follow the well builded code.thak you so much guys.you done a good job.i have to know this will work for windows phone?, and how can i do that.i am really new to laravel.i tried by windows phone.but it shows same android os.can u please help me.thak you so much.

L5.4 - Call to undefined method Illuminate\Foundation\Application::share()

I'm using Laravel 5.4. When I run php artisan vendor:publish it gives me following error:

[Symfony\Component\Debug\Exception\FatalThrowableError] Call to undefined method Illuminate\Foundation\Application::share()

I've the quick solution to this problem. I will raise a pull request. Please consider merging my code in your upcoming release.

Remove version from composer.json

You should not have the version bit in composer.json, because Packagist will not pick up newer releases, since the composer.json is stuck at 2.0.2

as an added bonus when you tag new releases in git, they should automatically be picked up by packagist, no further intervention needed.

Error on Laravel 5.4

local.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Call to undefined method Illuminate\Foundation\Application::share()' in C:\myProject\vendor\hisorange\browser-detect\src\Provider\BrowserDetectService.php:48

Please! How can I solve this?

iPad detected as mobile

The user agent Mozilla/5.0 (iPad; CPU OS 8_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B410 Safari/600.1.4 gets detected as mobile not tablet.

Result from user agent:

isMobile: true
isTablet: false
isDesktop: false
isBot: false
browserFamily: Safari
browserVersionMajor: 8
browserVersionMinor: 0
browserVersionPatch: 0
osFamily: iPhone OS
osVersionMajor: 8
osVersionMinor: 0
osVersionPatch: 0
deviceFamily: iPad
deviceModel: iPad
mobileGrade: A
cssVersion: 3
javaScriptSupport: true

Error in Laravel 5.4

[2017-04-13 01:30:52] local.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Call to undefined method Illuminate\Foundation\Application::share()' in C:\wamp64\www\Direciona_SITE_2017\vendor\hisorange\browser-detect\src\Provider\BrowserDetectService.php:48
Stack trace:
#0 {main}

Local use

Is it normal that i always have default results on my local application?

Minor update to ReadMe

Hi there,

Was checking out your module on Laravel 4.2 and noticed that in your current read me you are using the artisan command for laravel 5.

I looked through your commits and found:

php artisan config:publish hisorange/browser-detect - for Laravel 4

Since you include version 1.* instructions, the above command works properly! Minor update. Thanks!

updating from dev-master to 1.* causing error

I've had the most recent "dev-master" version installed. I wanted to update to "1.*" and am getting the following error:

Updating dependencies (including require-dev)

  • Installing hisorange/traits (dev-master b91633e)
    Loading from cache
  • Removing garetjax/phpbrowscap (dev-master ed66171)
  • Installing garetjax/phpbrowscap (2.0)
    Loading from cache
  • Removing hisorange/browser-detect (dev-master 4000aa9)
  • Installing hisorange/browser-detect (dev-develop-1 c4e2619)
    Loading from cache

Writing lock file
Generating autoload files
PHP Fatal error: Class 'hisorange\browserdetect\Providers\BrowserDetectServiceProvider' not found in /usr/share/nginx/picantewsdev/html/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 158
{"error":{"type":"Symfony\Component\Debug\Exception\FatalErrorException","message":"Class 'hisorange\browserdetect\Providers\BrowserDetectServiceProvider' not found","file":"/usr/share/nginx/picantewsdev/html/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php","line":158}}{"error":{"type":"Symfony\Component\Debug\Exception\FatalErrorException","message":"Class 'hisorange\browserdetect\Providers\BrowserDetectServiceProvider' not found","file":"/usr/share/nginx/picantewsdev/html/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php","line":158}}Script php artisan clear-compiled handling the post-update-cmd event returned with an error

[RuntimeException]
Error Output: PHP Fatal error: Class 'hisorange\browserdetect\Providers\BrowserDetectServiceProvider' not found in /usr/share/nginx/picantewsdev/html/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line
158

Package rewamp. Future plans.

I promise I will rewamp the whole package one day and fix the issues with the versioning and the tablet detecting. But right now I am not working with Laravel at all, and I have no plans to return to it, so the package will be independent, but ofc will still keep the Laravel support just in a different manner.

!!! This does not mean the package is broken, only minor issues but the issue is connected to the way how I manage plugins atm. In the future I plan to make a different model which is more flexible and easier to support across different frameworks.

showing safari , in chorme device toolbar

when i am testing it in to normal mode of chorme browser is showing chorme this is right but when i testing it into chorme device toolbar (iPhone 6s) it is showing safari. i tested many more package but this issue is showing in all packages and also in this package

Problem when installing Laravel 5.4

When I updated to Laravel 5.4, I get this error when trying to vendor:publish:

  [Symfony\Component\Debug\Exception\FatalErrorException]              
  Call to undefined method Illuminate\Foundation\Application::share() 

And I get this error in my browser:

FatalErrorException in BrowserDetectService.php line 48:
Call to undefined method Illuminate\Foundation\Application::share()

What could this be? It has to do with this package because I did a fresh install without browser-detect and I have no problems.

Not working with native apps.

Hello.
I am using this as API in my application.

$agent = BrowserDetect::detect();
return Response()->json(ResponseManager::getResult($agent, 10, ''));

Everything working fine but when i try to call using android native app then this would return wrong result. So is there any possibilities to how to get accurate result with native apps.

Thanks

Error after composer update

Hi, I've just update through the composer and I got the current error:

Argument 1 passed to hisorange\BrowserDetect\Parser::objectConfigImport() must be of the type array, null given, called in C:\xampp\htdocs\greekhotelsapi\vendor\hisorange\browser-detect\src\Parser.php on line 77 and defined (View: C:\xampp\htdocs\greekhotelsapi\resources\views\homepage.blade.php)

I'm only using these examples: BrowserDetect::isTablet(), BrowserDetect::isDesktop(), BrowserDetect::isMobile(), and everything seemed to be working just fine before.

Could you please advice?

Opera issue

Using this package for my site to check if browser is Desktop, Tablet or Mobile and in opera I get the following:

ErrorException
touch(): Utime failed: Permission denied (View: /home/*/**//****/index.blade.php)

This is the site and works well in Chrome, FF, but in Opera I get the error.
http://letsgomacedonia.com

You might be interested to check.
Best regards,

Detect Lumia

Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 630 Dual SIM) like iPhone OS 7_0_3 Mac OS X AppleWebKit/537 (KHTML, like Gecko) Mobile Safari/537

  • "isMobile" => true
    
  • "isTablet" => false
    
  • "isDesktop" => false
    
  • "isBot" => false
    
  • "browserFamily" => "Internet Explorer"
    
  • "browserVersionMajor" => 0
    
  • "browserVersionMinor" => 0
    
  • "browserVersionPatch" => 0
    
  • "osFamily" => "AndroidOS"
    
  • "osVersionMajor" => 0
    
  • "osVersionMinor" => 0
    
  • "osVersionPatch" => 0
    
  • "deviceFamily" => "Nokia"
    
  • "deviceModel" => "iPhone"
    
  • "mobileGrade" => "A"
    
  • "cssVersion" => 0
    
  • "javaScriptSupport" => true
    

iPad is being detected as mobile instead of tablet

Hi mate, first of all thanks for you work, it's awesome!
I'm using it in production in a site called Resermap (www.resermap.com) and it's detecting that the iPad is a mobile (redirecting it to the mobile web site) instead of keeping it in the regular (responsive) website, as a tablet should do.
Do I have to configure something else for this to work as I mention?
Thanks again!

Not working on lumen 5.2

I've used this :
$result = \BrowserDetect::detect(); & tried $result = BrowserDetect::detect();
but it returns :

Argument 1 passed to hisorange\BrowserDetect\Parser::__construct() must be an instance of Illuminate\Foundation\Application, instance of Laravel\Lumen\Application given, called in /home/vagrant/t2s-api/vendor/hisorange/browser-detect/src/Provider/BrowserDetectService.php on line 49 and defined

Here is the 4 list I have followed

app.php :
1. $app->register(hisorange\BrowserDetect\Provider\BrowserDetectService::class);
2. class_alias('hisorange\BrowserDetect\Facade\Parser', 'BrowserDetect');

Composer
3. { "require": { "hisorange/browser-detect": "2.*" } }

& Artisan
4. php artisan vendor:publish

Can't get it to work on larval 5

I've followed all the installation steps but i get this error

  Class 'App\Http\Controllers\BrowserDetect' not found

I'm trying to use it in a view in a controller like this:

  BrowserDetect::detect();

Please help! :3

Can not install

Hello, I can not install this! :(

Your requirements could not be resolved to an installable set of packages.

Problem 1
- hisorange/browser-detect v0.9.0 requires yzalis/ua-parser dev-master -> no matching package found.
- hisorange/browser-detect 0.9.2 requires yzalis/ua-parser dev-master -> no matching package found.
- hisorange/browser-detect 0.9.1 requires yzalis/ua-parser dev-master -> no matching package found.
- Installation request for hisorange/browser-detect 0.9.* -> satisfiable by hisorange/browser-detect[0.9.1, 0.9.2, v0.9.0].

Potential causes:

Read http://getcomposer.org/doc/articles/troubleshooting.md for further common problems.

Platform Call

Add a call ->platform to return (desktop,tablet,mobile,bot)

Error in ObjectConfig.php: Argument must be array, null given

Great script, but I suddenly have trouble getting this package to work properly on Laravel 5. Here is the error thrown:

"ErrorException in /var/www/test-site/vendor/hisorange/traits/src/ObjectConfig.php line 70:
Argument 1 passed to hisorange\BrowserDetect\Parser::objectConfigImport() must be of the type array, null given, called in /var/www/test-site/vendor/hisorange/browser-detect/src/Parser.php on line 77 and defined (View: /var/www/test-site/resources/views/site/index.blade.php)"

The line causing the error on my index page is as follows:

My config\app.php is setup properly for both providers and aliases. I have even tried removing and then re-installing ~2.0 with composer, but I still get the error.

I'm not sure what is wrong. Any ideas or suggestions would be of great help. Any thoughts?

Only see "HiSoRange Generic Browser" - Laravel 5.3

Hi

I've tried to make this work for a few hours now with no success...

Followed your instructions.
hisorange\BrowserDetect\Provider\BrowserDetectService::class,
and
'BrowserDetect' => hisorange\BrowserDetect\Facade\Parser::class,

in app.php

but

 $result = \BrowserDetect::detect();
        dd($result);

shows me only

Result {#164 ▼
  #attributes: array:17 [▼
    "isMobile" => false
    "isTablet" => false
    "isDesktop" => true
    "isBot" => false
    "browserFamily" => "HiSoRange Generic Browser"
    "browserVersionMajor" => 0
    "browserVersionMinor" => 0
    "browserVersionPatch" => 0
    "osFamily" => "HiSoRange Generic OS"
    "osVersionMajor" => 0
    "osVersionMinor" => 0
    "osVersionPatch" => 0
    "deviceFamily" => ""
    "deviceModel" => ""
    "mobileGrade" => ""
    "cssVersion" => 0
    "javaScriptSupport" => true
  ]
}

I tried it with Google Chrome and Firefox (both latest Windows versions), same result.

Is there anything I'm missing?

Using Laravel 5.3

thanks!

Ipad Version

Hi,

I'm testing the tablet detection with BrowserDetect::detect() and BrowserDetect::isTablet(). When I use desktop version or mobile, it's work, but if I used iPad, dosen't work, BrowserDetect::isTablet() return false.

I try with iPad 2. I am doing something wrong?

Regards!

Issues with publish config files

php artisan vendor:publish
Copied File [/vendor/hisorange/browser-detect/src/config/config.php] To [/config/hisorange/browser-detect/browser-detect-config.php]
Copied File [/vendor/hisorange/browser-detect/src/config/plugins.php] To [/config/hisorange/browser-detect/browser-detect-plugins.php]

Publishing Complete!

This generates config files under "/config/hisorange/browser-detect/" folder where you use /config/ folder ...
Hopes you can resolve the issue.

OS version detects Browser Version

Here is a dump of the return of detect-method, but added a user-agent value to the array so you can see it all.

It says that OS version is 38.0.2125, but this is the Chrome version, not the OS version.

object(hisorange\BrowserDetect\Result)[330]
  protected 'attributes' => 
    array (size=18)
      'isMobile' => boolean false
      'isTablet' => boolean false
      'isDesktop' => boolean true
      'isBot' => boolean false
      'browserFamily' => string 'Chrome' (length=6)
      'browserVersionMajor' => int 38
      'browserVersionMinor' => int 0
      'browserVersionPatch' => int 2125
      'osFamily' => string 'OS X' (length=4)
      'osVersionMajor' => int 38
      'osVersionMinor' => int 0
      'osVersionPatch' => int 2125
      'deviceFamily' => string '' (length=0)
      'deviceModel' => string '' (length=0)
      'mobileGrade' => string '' (length=0)
      'cssVersion' => int 1
      'javaScriptSupport' => boolean true
      'user-agent' => string 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.122 Safari/537.36' (length=121)

Browser version is not shown

Hello,

I'm using Laravel 5.1.27

When I do this:

var_dump(\BrowserDetect::browserVersion());

I get a empty string.

Even if I do this:

$browser = \BrowserDetect::detect()->toArray();
dd($browser);

The versions (major, minor, patch) of browser and os, it is always zero.

I tried this with Chrome, Firefox and Safari on a MacBook.

Or maybe this is normal when I see an application locally?

Thanks.

Windows 10 wrong detection

Hi,

I've tested BrowserDetect::browserFamily() using Chrome browser in Windows 7 and it returns Chrome which is correct. However in Windows 10 it returns Hisorange Generic Browser. Is there any solution to this that I can do on my side?

Thanks.

Yaml::parse() error when using BrowserDetect class

I updated composer yesterday and wherever I use this class, I get an error as follows:

ErrorException (E_UNKNOWN) The ability to pass file names to Yaml::parse() was deprecated in 2.2 and will be removed in 3.0. Please, pass the contents of the file instead.

Here is a sample code of what fails:

I am using browser-detect on a Laravel 4.x installation. As soon as I remove this, my page works fine.

ReflectionException: Class browser-detect.parser does not exist

Hi,
I'm using Laravel 4.2 and after installing your package I've got an error id if I use any BrowserDetect method, I receive the following error: ReflectionException Class browser-detect.parser does not exist
Do you have any hint on how to resolve this problem?
Thanks

Opera is detected as Chrome

Hey! Just got this issue: Opera on Mac (probably on Win too) detects as Chrome.

Chrome user agent string: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36"
Opera's: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36 OPR/33.0.1990.115"

Opera has additional "OPR/33.0.1990.115".

Doesn't work for tablets.

BrowserDetect::isTablet() doesn't return anything. Checked it on chrome's emulator and Apple Ipad

Too wide & not working workbench dependency

instead of:

 "laravel/framework": "4.*",

please use, e.g:
"Illuminate/Support": "4.*",

When I use your package as dependency in my workbench package, I have two copies of vendors: whoops error handlers because of too wide dependency. What is more after composer update I've got an error which corresponds to browser detect:

vagrant@homestead:~/Projects/hydra-app$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
Error in exception handler: Undefined index: generic in /home/vagrant/Projects/hydra-app/workbench/hydra/core/vendor/hisorange/browser-detect/src/Parser.php:111Error in exception handler: Undefined index: generic in /home/vagrant/Projects/hydra-app/workbench/hydra/core/vendor/hisorange/browser-detect/src/Parser.php:111Error in exception handler: Undefined index: generic in /home/vagrant/Projects/hydra-app/workbench/hydra/core/vendor/hisorange/browser-detect/src/Parser.php:111vagrant@homestead:~/Projects/hydra-app$ 

Detect javscript

Hey, thanks for all your work on this, it's very usefull to integrate detect quiclky in new laravel project !

Do you thinks you could add javascript detection (enable or not) in forthcoming versions?

Minimum stability

Hello,
I'm trying to install browser-detect on my Laravel 4.1 and I'm unable to install the dev-master version nor the 0.9.2.

$ php composer.phar update                      
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for hisorange/browser-detect 0.9.2 -> satisfiable by hisorange/browser-detect[0.9.2].
    - hisorange/browser-detect 0.9.2 requires yzalis/ua-parser dev-master -> no matching package found.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.

Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

I have "minimum-stability": "stable" specified in my composer.json and I for safety I want to keep it. Is it possible to make a stable release?

can't install- failed dependencies

Trying to install this package in a new Laravel 4 installation, it's failing on one of the dependencies?

Problem 1
- Installation request for hisorange/browser-detect 1.* -> satisfiable by hisorange/browser-detect[1.0.1].
- hisorange/browser-detect 1.0.1 requires hisorange/traits dev-master -> no matching package found.

Browser Version Numbers Not Pulling Through

I'm using this in conjunction with an auth package for Laravel. (https://github.com/rajivseelam/api-laravel-sentry)

I'm currently testing my API I'm creating and I'm strictly using POSTMAN to do so. I noticed, however in each token request where BrowserDetect object is fired off, the versioning doesn't come through.

Could it be just a problem with POSTMAN? I'll follow up when I'm implementing AJAX calls into a front-end.

Laravel 5 support

Laravel 5 should be out next week, is the support planned or should I create a pull request? :)

Not Working on L 5.2

I've used this command :
$result = \BrowserDetect::isMobile();
but it returns :
Class 'BrowserDetect' not found

Here is my app.php :
providers' => [
hisorange\BrowserDetect\Provider\BrowserDetectService::class,
]

And Alias is :
aliases' => [
'BrowserDetect' => hisorange\BrowserDetect\Facade\Parser::class,
]

Any ideas?

Browser version ending up being 0

I get the following result using Chrome:

isMobile: false,
isTablet: false,
isDesktop: true,
isBot: false,
browserFamily: "Chrome",
browserVersionMajor: 0,
browserVersionMinor: 0,
browserVersionPatch: 0,
osFamily: "MacOSX",
osVersionMajor: 0,
osVersionMinor: 0,
osVersionPatch: 0,
deviceFamily: "",
deviceModel: "",
mobileGrade: "",
cssVersion: 1,
javaScriptSupport: true

and in Safari

isMobile: false,
isTablet :false,
isDesktop:true,
isBot: false,
browserFamily: Safari,
browserVersionMajor: 0,
browserVersionMinor: 0,
browserVersionPatch: 0,
osFamily: MacOSX,
osVersionMajor: 0,
osVersionMinor: 0,
osVersionPatch: 0,
deviceFamily: "",
deviceModel: "",
mobileGrade: "",
cssVersion: 1,
javaScriptSupport: true

Can this bug be fixed somehow or am I the only one getting it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.