cedricve/simpleauth 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

cedricve/simpleauth

最新稳定版本:v1.2.2

Composer 安装命令:

composer require cedricve/simpleauth

包简介

A simple authentication driver for Laravel

README 文档

README

A simple authentication driver, which makes it possible to define one or more users in the app.config file. This is great for mockup projects or when you don't have/need a database. This library extends the original Laravel auth drivers, so it uses exactly the same methods.

Installation

Install using composer:

composer require cedricve/simpleauth

Add the service provider in app/config/app.php:

'Cedricve\Simpleauth\SimpleauthServiceProvider',

The service provider will register a extension with the original auth manager. There is no need to register additional facades or objects.

Configuration

Change your default database connection name in app/config/auth.php:

'driver' => 'simple'

And add a new property to the app/config/app.php file:

'users' => [
    [
        "id" => 1,
        "username" => "root",
        "password" => "root",
        "firstname" => "Cédric",
        "secondname" => "Verstraeten"
        ...
    ],
    [
        "id" => 2,
        "username" => "root2",
        "password" => "root",
        "firstname" => "Cédric",
        "secondname" => "Verstraeten"
        ...
    ]
],

Examples

You can use the default Auth methods.

Basic Usage

Try to signin

Auth::attempt(['username' => 'root', 'password' => 'root'))

Retrieving the user that signed in

$user = Auth::user();

More info about authentication: http://laravel.com/docs/4.2/security

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-12-10