Download the PHP package spinen/laravel-browser-filter without Composer

On this page you can find all versions of the php package spinen/laravel-browser-filter. 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 laravel-browser-filter

SPINEN's Laravel Browser Filter

Latest Stable Version Latest Unstable Version Total Downloads License

This is a Laravel 5 middleware to filter routes based on browser types.

We specify the browsers that we are going to support at the beginning of a project, so this package makes sure that the visitor is using a supported browser.

Build Status

Branch Status Coverage Code Quality
Develop Build Status Code Coverage Scrutinizer Code Quality
Master Build Status Code Coverage Scrutinizer Code Quality

Prerequisites

NOTE: If you need to use PHP <7.2 or Laravel <5.2, please stay with version 1.x

As side from Laravel >= 5.5, there are 2 packages that are required:

Install

Install Browser Filter:

The package uses the auto registration feature of Laravel 5.

Register the middleware

The middleware needs to be registered with the Kernel to allow it to parse the request.

Laravel 11 & newer

Register the HTTP Stack Middleware for the web group in bootstrap/app.php:

Register the Route Middlewares in bootstrap/app.php:

Before Laravel 11

Register the HTTP Stack Middleware for the web group in app/Http/Kernel.php:

Register the Route Middlewares in app/Http/Kernel.php:

Page to show if blocked

Build a page with a named route to redirect blocked browsers to:

Configure middleware options

Publish the package config file to config/browserfilter.php:

This file is fully documented, so please read it to know how to configure the middleware. There are 4 top level items that you can configure...

  1. type - The type of filtering strategy to apply to the stack filter
  2. rules - The array of devices/browsers/versions to allow or block for ALL http requests
  3. route - The name of the route to redirect the user to if they are using a blocked client
  4. timeout - The length of time to cache the client data, where "0" disables the cache

Using the Route middleware

The route middleware uses the same configuration file as the stack middleware, but ignores the rules.

The rules are passed in after the ':' behind the route filter that you wish to use...

or

The format of the filter is Device/Browser/operatorVersion|operatorVersion2;Device/Browser2/operatorVersion, so the following rule:

would be written as: Mobile;Other/Ie/<10|>13;Tablet.


All versions of laravel-browser-filter with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-json Version *
illuminate/cache Version ^9.19|^10|^11
illuminate/routing Version ^9.19|^10|^11
illuminate/support Version ^9.42|^10|^11
mobiledetect/mobiledetectlib Version ~2.8
ua-parser/uap-php Version ~3.9
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 spinen/laravel-browser-filter contains the following files

Loading the files please wait ....