定制 graham-campbell/credentials 二次开发

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

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

graham-campbell/credentials

最新稳定版本:v0.4.0-alpha

Composer 安装命令:

composer require graham-campbell/credentials

包简介

Credentials Is A Cool Way To Authenticate In Laravel 5

README 文档

README

Laravel Credentials was created by, and is maintained by Graham Campbell, and is a cool way to authenticate in Laravel 5. It utilises many of my packages and Cartalyst's Sentry package. Feel free to check out the releases, license, and contribution guidelines.

Laravel Credentials

Build Status Coverage Status Quality Score Software License Latest Version

Installation

PHP 5.5+ or HHVM 3.6+, and Composer are required.

To get the latest version of Laravel Credentials, simply add the following line to the require block of your composer.json file:

"graham-campbell/credentials": "~1.0"

You'll also need to make sure our fork of Sentry is included in your repositories list:

{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/BootstrapCMS/Sentry"
        }
    ],
}

You'll then need to run composer install or composer update to download it and have the autoloader updated.

You will need to register many service providers before you attempt to load the Laravel Credentials service provider. Open up config/app.php and add the following to the providers key.

  • 'McCool\LaravelAutoPresenter\LaravelAutoPresenterServiceProvider'
  • 'Cartalyst\Sentry\SentryServiceProvider'
  • 'GrahamCampbell\Security\SecurityServiceProvider'
  • 'GrahamCampbell\Binput\BinputServiceProvider'
  • 'GrahamCampbell\Throttle\ThrottleServiceProvider'

Once Laravel Credentials is installed, you need to register the service provider. Open up config/app.php and add the following to the providers key.

  • 'GrahamCampbell\Credentials\CredentialsServiceProvider'

You can register the three facades in the aliases key of your config/app.php file if you like.

  • 'UserProvider' => 'GrahamCampbell\Credentials\Facades\UserProvider'
  • 'GroupProvider' => 'GrahamCampbell\Credentials\Facades\GroupProvider'
  • 'Credentials' => 'GrahamCampbell\Credentials\Facades\Credentials'

Configuration

Laravel Credentials supports optional configuration.

To get started, you'll need to publish all vendor assets:

$ php artisan vendor:publish

This will create a config/credentials.php file in your app that you can modify to set your configuration. Also, make sure you check for changes to the original config file in this package between releases.

There are a few config options:

Enable Public Registration

This option ('regallowed') defines if public registration is allowed. The default value for this setting is true.

Require Account Activation

This option ('activation') defines if public registration requires email activation. The default value for this setting is true.

Revision Model

This option ('revision') defines the revision model to be used. The default value for this setting is 'GrahamCampbell\Credentials\Models\Revision'.

Home

This option ('home') defines the location of the homepage. The default value for this setting is '/'.

Layout

This option ('layout') defines the layout to extend when building views. The default value for this setting is 'layouts.default'.

Email Layout

This option ('layout') defines the layout to extend when building email views. The default value for this setting is 'layouts.email'.

Additional Configuration

You will need to add a 'name' key to your app config to set the application name.

You may want to check out the config for cartalyst/sentry too. For Laravel Credentials to function correctly, you must set the models to the following, or to a class which extends the following:

  • 'GrahamCampbell\Credentials\Models\Group'
  • 'GrahamCampbell\Credentials\Models\User'
  • 'GrahamCampbell\Credentials\Models\Throttle'

Usage

There is currently no usage documentation for Laravel Credentials, but we are open to pull requests.

License

Laravel Credentials is licensed under The MIT License (MIT).

统计信息

  • 总下载量: 21.13k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 58
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 56
  • Watchers: 4
  • Forks: 17
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-12-22