Download the PHP package handsetdetection/laravel51-provider without Composer

On this page you can find all versions of the php package handsetdetection/laravel51-provider. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel51-provider

Laravel 5.1 LTS Wrapper for Handset Detection

A minimal service provider to set up and use the Handset Detection 4.x PHP library in Laravel v5.1 LTS.

Usage example

/**
 * Where $httpHeaders is a key=>value array of headers, for example :
 *     array(
 *         'user-agent' => "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like Mac OS X; fr_FR) AppleWebKit (KHTML, like Gecko) Mobile"
 *     )
 **/
$hd = App('HandsetDetection');
$hd->deviceDetect($httpHeaders);

Call any of the Handset Detection 4.x PHP library methods in this same fashion. Additional examples at PHP APIKit Home .

$hd->deviceVendors();
$hd->deviceModels('Nokia');
$hd->deviceWhatHas('network', 'EDGE');
$hd->deviceFetchArchive();
$hd->communityFetchArchive();

Here's a snippet that ties it all together with a few sample detections.

$data = array (
    array (
        'user-agent' => "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36"
    ),
    array (
        'user-agent' => "Mozilla/5.0 (Linux; U; Android 2.3.6; en-us; SAMSUNG-SGH-I577 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"
    ),
    array (
        'user-agent' => "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like Mac OS X; fr_FR) AppleWebKit (KHTML, like Gecko) Mobile [FBAN/FBForIPhone;FBAV/4.0.2;FBBV/4020.0;FBDV/iPhone3,1;FBMD/iPhone;FBSN/iPhone OS;FBSV/4.3.3;FBSS/2; FBCR/TELUS;FBID/phone;FBLC/fr_FR;FBSF/2.0]"
    ),
    array (
        'user-agent' => "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like Mac OS X; fr_FR) AppleWebKit (KHTML, like Gecko) Mobile",
        'x-local-hardwareinfo' => "480:320:275:200"
    )
);

$hd = App('HandsetDetection');
foreach ($data as $headers) {
    $return = $hd->deviceDetect($headers);
    $reply = $hd->getReply();
    $this->info(json_encode($reply));
}

Setup

Step 1: Adding the dependency to composer.json

Add this to your composer.json. This will also fetch

"require": {
    "handsetdetection/laravel51-provider": "1.*",
}

Step 2: Register the service provider

Register the service provider in config/app.php by inserting into the providers array

'providers' => [
    HandsetDetection\Laravel51Provider\HandsetDetectionServiceProvider::class,
]

Step 3: From the command-line run

php artisan vendor:publish --provider="HandsetDetection\Laravel51Provider\HandsetDetectionServiceProvider"

This will publish config/handsetdetection.php to your config folder.

Step 4: Edit your config file

Place your Handset Detection access credentials in the config file.

Job Done.

Let us know if you have any hassles : [email protected]

Happy Detecting :-)


All versions of laravel51-provider with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version >5.1
handsetdetection/php-apikit Version 4.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package handsetdetection/laravel51-provider contains the following files

Loading the files please wait ....