PHPackages                             hwacom/eip-login - 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. hwacom/eip-login

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

hwacom/eip-login
================

EIP Login Package

v1.2.0(8mo ago)0415MITPHPPHP ^8.3

Since Aug 5Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/HwacomService/EIP-Login)[ Packagist](https://packagist.org/packages/hwacom/eip-login)[ RSS](/packages/hwacom-eip-login/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (20)Used By (0)

EIP Login Package via Hwacom
============================

[](#eip-login-package-via-hwacom)

[![Build Status](https://github.com/mozielin/Client-SSO/workflows/PHP Composer/badge.svg)](https://github.com/mozielin/Client-SSO/actions)[![Total Downloads](https://camo.githubusercontent.com/2db62124c9cd0207edeb7a389cb6c5adfe1e16338ba7221546299aac04ff1733/687474703a2f2f706f7365722e707567782e6f72672f687761636f6d2f636c69656e742d73736f2f646f776e6c6f616473)](https://packagist.org/packages/hwacom/client-sso)[![Latest Stable Version](https://camo.githubusercontent.com/ece3f14933e8a5667f2015e53b5841d38a9ee300762dcce0995aa441db2e0225/687474703a2f2f706f7365722e707567782e6f72672f687761636f6d2f636c69656e742d73736f2f76)](https://packagist.org/packages/hwacom/client-sso)

安裝說明
----

[](#安裝說明)

```
composer require hwacom/eip-login
```

需提前安裝並設定的套件
-----------

[](#需提前安裝並設定的套件)

laravel/breeze

```
php artisan breeze:install

```

```
npm uninstall tailwindcss postcss autoprefixer

```

```
npm install tailwindcss@npm:@tailwindcss/postcss7-compat @tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9

```

```
npm install

```

```
npm run dev

```

```
php artisan migrate

```

SSO 登入
[hwacom/client-sso](https://github.com/HwacomService/SSO-Client)

人員資料 HRepository
[hwacom/personnel-info](https://github.com/HwacomService/Personnel-Info)

Service Provider設定 (Laravel 5.5^ 會自動掛載)
---------------------------------------

[](#service-provider設定-laravel-55-會自動掛載)

Composer安裝完後要需要修改 `config/app.php` 找到 providers 區域並添加:

```
\Hwacom\EIPLogin\EIPLoginServiceProvider::class,
```

Config設定檔發佈
-----------

[](#config設定檔發佈)

用下列指令會建立eip.php設定檔，需要在 `.env` 檔案中增加設定， 同時建立出eip\_login語系檔

```
php artisan vendor:publish
```

下列設定會自動增加在 `config/eip.php`

```
'eip_auth' => env('EIP_AUTH', false),
'eip_url' => env('EIP_URL'),
'JWT_EXP' => env('JWT_EXP', 900),
'CLIENT_SECRET' => env('EIP_CLIENT_SECRET'),
'COOKIE_DOMAIN' => env('COOKIE_DOMAIN'),

'model' => App\Models\User::class,
```

在`.env` 中增加設定

```
EIP_AUTH          = true
EIP_URL           =
EIP_CLIENT_SECRET =
COOKIE_DOMAIN     =
```

\[LoginController\] 增加兩個Function
--------------------------------

[](#logincontroller-增加兩個function)

```
use Hwacom\EIPLogin\Services\EIPLoginService;
use Illuminate\Foundation\Auth\AuthenticatesUsers;

```

```
class LoginController extends Controller
{
    use AuthenticatesUsers;

    public function __construct()
    {
        $this->loginService = new EIPLoginService();
    }

```

增加function

```
public function username()
{
    return 'enumber'; //帳號欄位名
}

```

Login

```
/**
 * 進入login前function 判斷走login/loginEIP
 *
 */
public function store()
{
    if (config('eip.eip_auth')) { //EIP登入
            $data = [
                'ip'             => $request->ip(),
                'username'       => $request->enumber,
                'password'       => $request->password,
            ];
            $this->loginService->loginEIP($data);
            $path = Session::get('redirect) ?? '/';
            $request->session()->regenerate();
            return redirect($path);
    } else {
        $this->login($request); //一般登入

        $request->session()->regenerate();

        return redirect()->intended(RouteServiceProvider::HOME);
    }

}

```

Logout

```
/**
 * 登出用需自行寫入LoginController中
 *
 * @param  \Illuminate\Http\Request  $request
 * @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
 */
public function destroy(Request $request)
{
    if (config('sso.sso_enable') === true) {
        setcookie("token", "", time() - 3600, '/', '.hwacom.com');
    }

    Auth::guard('web')->logout();

    $request->session()->invalidate();

    $request->session()->regenerateToken();

    setcookie("token", "", time() - 3600, '/', config('eip.COOKIE_DOMAIN'));

    return redirect(config("sso.sso_host"));
}

```

\[LoginRequest\] 調整rules
------------------------

[](#loginrequest-調整rules)

```
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        if (!config('eip.eip_auth')) {
            return [
                'enumber'  => 'required|string',
                'password' => 'required|string',
            ];
        } else {
            return [];
        }
    }

```

\[login.blade\] 調整
------------------

[](#loginblade-調整)

帳號input調整

```

```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance61

Regular maintenance activity

Popularity13

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity71

Established project with proven stability

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 ~62 days

Recently: every ~228 days

Total

19

Last Release

250d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/76101f5a95034572964a49b9cb2032caeaac4526b9f418afadfc34a3952853b5?d=identicon)[HwacomService](/maintainers/HwacomService)

### Embed Badge

![Health badge](/badges/hwacom-eip-login/health.svg)

```
[![Health](https://phpackages.com/badges/hwacom-eip-login/health.svg)](https://phpackages.com/packages/hwacom-eip-login)
```

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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