定制 clumsy/age-check 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

clumsy/age-check

最新稳定版本:v0.2.6

Composer 安装命令:

composer require clumsy/age-check

包简介

An age checker for Laravel

README 文档

README

Codacy Badge SensioLabsInsight

A package to help create an age-check verification.

License

Clumsy Age-Check is open-sourced software licensed under the MIT license

Installation

To get started with Age-Check, add to your composer.json file as a dependency:

composer require clumsy/age-check:0.2.*

If you are using Laravel 4, stick to the branch 0.1:

composer require clumsy/age-check:0.1.*

Configuration

After installing the Age-Check library, register the ServiceProvider in your config/app.php configuration file:

'providers' => [
    // Other service providers...

    Clumsy\AgeCheck\AgeCheckServiceProvider::class,
],

Register the middleware in your app/Http/Kernel.php file:

protected $routeMiddleware = [
        //Other middlewares...

        'age-check' => \Clumsy\AgeCheck\Http\Middleware\ValidateAge::class,
    ];

Publish the config file:

php artisan vendor:publish --provider="Clumsy\AgeCheck\AgeCheckServiceProvider" --tag="config"

and edit it according to your project. Usually you want to edit the success-url and fail-url which are the urls where the user will get redirected in case of fail or success.

Usage

Create a route group with the age-check middleware in it:

Route::group(
    [
        'middleware' => ['age-check']
    ],
    function() {
        //Your routes goes here...
    }
);

This package gives you a basic view with a basic form without styling. You should change the config file to use one of you own and use the partials views provided to help you generate the form.

You can also publish the views and change them to suit your needs:

php artisan vendor:publish --provider="Clumsy\AgeCheck\AgeCheckServiceProvider" --tag="views"

统计信息

  • 总下载量: 164
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-04-07