定制 baileylo/session-user 二次开发

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

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

baileylo/session-user

Composer 安装命令:

composer require baileylo/session-user

包简介

Authenticated User injection for auto resolving IOCs

README 文档

README

An easy way to inject the authenticated User into your Controllers.

Installation

Step 1: Install the package

Add this line to your composer.json

"baileylo/session-user": "1.0.0"

Or, use the commandline:

composer require baileylo/session-user

Step 2: Register the Service Provider(Laravel Specific)

Edit your app/config/app.php file and add this line to the providers array:

'Portico\SessionUser\LaravelSessionUserProvider'

Step 3: Update your User Object

Add the following interface to your User model/entity,

\Portico\SessionUser\SessionUser

So your class may now look like this

<?php

use Portico\SessionUser\SessionUser;

class User extends Eloquent Implements SessionUser

Usage

In controllers where all functions require authentication you can update the constructor to pass in the authenticated user.

<?php

use Portico\SessionUser\SessionUser;

class MyController {
	protected $user;
	public function __construct(SessionUser $user)
	{
		$this->user = $user;
	}
}

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固