PHPackages                             goodspb/laravel5-ucenter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. goodspb/laravel5-ucenter

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

goodspb/laravel5-ucenter
========================

Larave5 ucenter

v1.2(10y ago)106886[1 issues](https://github.com/goodspb/laravel5-ucenter/issues)MITPHPPHP &gt;=5.4.0

Since Oct 8Pushed 9y ago2 watchersCompare

[ Source](https://github.com/goodspb/laravel5-ucenter)[ Packagist](https://packagist.org/packages/goodspb/laravel5-ucenter)[ Docs](https://github.com/goodspb/laravel5-ucenter)[ RSS](/packages/goodspb-laravel5-ucenter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

ucenter for Laravel 5
---------------------

[](#ucenter-for-laravel-5)

Laravel 5 / 5.1 ucenter.

[![Latest Stable Version](https://camo.githubusercontent.com/d398a186f7f1b72f8c781787b610ac11a219991526e1d221a151fcb9c398194f/68747470733a2f2f706f7365722e707567782e6f72672f676f6f647370622f6c61726176656c352d7563656e7465722f762f737461626c65)](https://packagist.org/packages/goodspb/laravel5-ucenter) [![License](https://camo.githubusercontent.com/e7d78567f3cb3b0afcd58cd074d153e3ce05a3d6b4398a83f6341b0c4f520d90/68747470733a2f2f706f7365722e707567782e6f72672f676f6f647370622f6c61726176656c352d7563656e7465722f6c6963656e7365)](https://packagist.org/packages/goodspb/laravel5-ucenter) [![Total Downloads](https://camo.githubusercontent.com/051119db40efd945fd3a87faacdce55cfc90ad2125c63bd3c94ebc1c08d67243/68747470733a2f2f706f7365722e707567782e6f72672f676f6f647370622f6c61726176656c352d7563656e7465722f646f776e6c6f616473)](https://packagist.org/packages/goodspb/laravel5-ucenter)

### 安装

[](#安装)

只要在你的 `composer.json` 文件require中加入下面内容，就能获得最新版.

```
"goodspb/laravel5-ucenter": "dev-master"

```

然后需要运行 "composer update" 来更新你的项目

安装完后，在 `app/config/app.php` 文件中找到 `providers` 键，

```
Goodspb\Laravel5Ucenter\UcenterServiceProvider::class,

```

找到 `aliases` 键，

```
'Ucenter' => Goodspb\Laravel5Ucenter\Facades\Ucenter::class,

```

配置
--

[](#配置)

将以下配置保存到 `根\config` 的 ucenter.php中,或者直接从该项目的src/config中拷贝过去

ucenter配置项

```
//ucenter.php
'url'       => env('ucenter_url','/api/ucapi'), // 网站UCenter接受数据地址 注意路由配置
'api'       => env('ucenter_api','http://localhost/ucenter'), // UCenter 的 URL 地址, 在调用头像时依赖此常量
'connect'   => env('ucenter_connect','mysql'), // 连接 UCenter 的方式: mysql/NULL, 默认为空时为 fscoketopen()
'dbhost'    => env('ucenter_dbhost','localhost'), // UCenter 数据库主机
'dbuser'    => env('ucenter_dbuser','root'), // UCenter 数据库用户名
'dbpw'      => env('ucenter_dbpw','root'), // UCenter 数据库密码
'dbname'    => env('ucenter_dbname','ucenter'), // UCenter 数据库名称
'dbcharset' => env('ucenter_dbcharset','utf8'),// UCenter 数据库字符集
'dbtablepre'=> env('ucenter_dbtablepre','uc_'), // UCenter 数据库表前缀
'key'       => env('ucenter_key','6bc3bbKaoWnVrb26juVvk4uq4c2a5SNQvzv70Zs'), // 与 UCenter 的通信密钥, 要与 UCenter 保持一致
'charset'   => env('ucenter_charset','utf-8'), // UCenter 的字符集
'ip'        => env('ucenter_ip','127.0.0.1'), // UCenter 的 IP, 当 UC_CONNECT 为非 mysql 方式时, 并且当前应用服务器解析域名有问题时, 请设置此值
'appid'     => env('ucenter_appid',5), //当前应用的 ID
'ppp'       => env('ucenter_ppp',20), //当前应用的每页数量

```

路由配置 将该项目中的src/routes.php中的路由定义配置到对应自己项目中的routes.php文件中

使用
--

[](#使用)

例如：获取用户名为admin的信息

###### 1、使用execute

[](#1使用execute)

```
$result = Ucenter::execute('uc_get_user',['admin']);
var_dump($result);

```

###### 2、直接使用方法名

[](#2直接使用方法名)

```
$result = Ucenter::uc_get_user('admin');
var_dump($result);

```

感谢
--

[](#感谢)

fork自  更改以适应 laravel 5以上

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

3875d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d8722964083163e14ac997afc808bc2118a2bd58a10710bb66902980156236a0?d=identicon)[goodspb](/maintainers/goodspb)

---

Top Contributors

[![goodspb](https://avatars.githubusercontent.com/u/10245385?v=4)](https://github.com/goodspb "goodspb (12 commits)")[![fengxiaochuang](https://avatars.githubusercontent.com/u/6743524?v=4)](https://github.com/fengxiaochuang "fengxiaochuang (1 commits)")

---

Tags

laravel5ucenter

### Embed Badge

![Health badge](/badges/goodspb-laravel5-ucenter/health.svg)

```
[![Health](https://phpackages.com/badges/goodspb-laravel5-ucenter/health.svg)](https://phpackages.com/packages/goodspb-laravel5-ucenter)
```

###  Alternatives

[anhskohbo/no-captcha

No CAPTCHA reCAPTCHA For Laravel.

1.8k8.5M33](/packages/anhskohbo-no-captcha)[albertcht/invisible-recaptcha

Invisible reCAPTCHA For Laravel.

6031.6M6](/packages/albertcht-invisible-recaptcha)[imanghafoori/laravel-heyman

A package to help you write expressive defensive code in a functional manner

92537.1k5](/packages/imanghafoori-laravel-heyman)[callmenp/lara-auth-bridge

Offers a simple API for the included custom phpBB authentication module. for phpBB3.0 and laravel5

161.1k](/packages/callmenp-lara-auth-bridge)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
