Download the PHP package fbf/laravel-agegate without Composer

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

Laravel-Agegate

A Laravel 4 package for adding an age gate to a site

Features

Installation

Add the following to you composer.json file

"fbf/laravel-agegate": "dev-master"

Run

composer update

Add the following to app/config/app.php

'Fbf\LaravelAgegate\LaravelAgegateServiceProvider'

Publish the config

php artisan config:publish fbf/laravel-agegate

Configuration

URI of the agegate page

'agegate_uri' => 'agegate',

The minimum age to access the site

'minimum_age' => 18,

The input type to use. Choices are: "date" for html5 input type="date" "select" for 3 select tags for day, month and year

'input_type' => 'select',

The name of the cookie to set. Change this to whatever you want

'cookie_name' => 'age_ok',

The value of the cookie to set. Change this to something unique

'cookie_val' => 'hell yeah!',

The age of the cookie to set. Options are 'forever', an integer (minutes) or the default is for the session

'cookie_age' => 'forever',

Determines whether the user can try again, if they entered a dob that makes them too young, or not. This lasts the session

'can_try_again' => false,

The view that should be rendered for the agegate. You can use the bundled view, or specify your own and use @include('laravel-agegate::agegate') to get the agegate form and validation errors

'view' => 'laravel-agegate::agegate',

The mode for allowed user agents (see section on Allowing bots etc below)

'allowed_user_agents.mode' => 'phpbrowscap_crawler'

The strings for allowed user agents, for the mode = exact or mode = contains setting (see section on Allowing bots etc below)

'allowed_user_agents.strings' => array(...)

Usage

Register the filter by adding the following to app/filters.php

Route::filter('agegate', 'Fbf\LaravelAgegate\LaravelAgegateFilter');

and apply it to the routes you want to protect by adding the following to app/routes.php

Route::when('my/routes/*', 'agegate');

or

Route::group(array('before' => 'agegate'), function()
{
    // My routes
});

You also need to add the agegate routes to your app/routes.php, for example:

Route::get(
    Config::get('laravel-agegate::agegate_uri'),
    'Fbf\LaravelAgegate\AgegateController@agegate'
);

Route::post(
    Config::get('laravel-agegate::agegate_uri'),
    array(
        'before' => 'csrf',
        'uses' => 'Fbf\LaravelAgegate\AgegateController@doAgegate'
    )
);

If you are using route prefixes in combination with the agegate filter, you can do the following:

Route::get(
    Request::segment(1).'/'.Config::get('laravel-agegate::agegate_uri'),
    'Fbf\LaravelAgegate\AgegateController@agegate'
);

Route::post(
    Request::segment(1).'/'.Config::get('laravel-agegate::agegate_uri'),
    array(
        'before' => 'csrf',
        'uses' => 'Fbf\LaravelAgegate\AgegateController@doAgegate'
    )
);

Allowing bots/crawlers/spiders through

You can prevent them by setting the config setting allowed_user_agents.mode to none

If you do want to allow certain user agents through the package provides 3 approaches:


All versions of laravel-agegate with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
illuminate/support Version 4.*
garetjax/phpbrowscap Version 2.0.*
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 fbf/laravel-agegate contains the following files

Loading the files please wait ....