PHPackages                             filsh/yii2-user - 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. filsh/yii2-user

ActiveYii2-extension[Authentication &amp; Authorization](/categories/authentication)

filsh/yii2-user
===============

Yii 2 user authentication module

1.0.0-beta(12y ago)088MITPHP

Since Apr 17Pushed 11y ago1 watchersCompare

[ Source](https://github.com/Filsh/yii2-user)[ Packagist](https://packagist.org/packages/filsh/yii2-user)[ RSS](/packages/filsh-yii2-user/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (2)Used By (0)

Yii 2 User
==========

[](#yii-2-user)

Yii 2 User - User authentication module

Demo
----

[](#demo)

[See here](http://yii2.amnahdev.com/user)

Features
--------

[](#features)

- Quick setup - works out of the box so you can see what it does
- Easily extendable ([instructions below](#how-do-i-extend-this-package))
- Registration using email and/or username
- Login using email and/or username
- Email confirmation (+resend functionality)
- Account page
    - Updates email, username, and password
    - Requires current password
- Profile page
    - Lists custom fields for users, e.g., *full\_name*
- Password recovery
- Admin crud via GridView

Installation
------------

[](#installation)

- Install [Yii 2](http://www.yiiframework.com/download) using your preferred method
- Install package via [composer](http://getcomposer.org/download/) `"filsh/yii2-user": "dev-master"`
- Update config file *config/web.php* and *config/db.php*

```
// app/config/web.php
return [
    'components' => [
        'user' => [
            'class' => 'filsh\yii2\user\components\User',
        ],
        'mail' => [
            // set up mail for emails
        ]
    ],
    'modules' => [
        'user' => [
            'class' => 'filsh\yii2\user\Module',
            // set custom module properties here ...
        ],
    ],
];
// app/config/db.php
return [
        'class' => 'yii\db\Connection',
        // set up db info
];
```

- Run migration file
    - `php yii migrate --migrationPath=@vendor/filsh/yii2-user/migrations`
- Go to your application in your browser
    - `http://localhost/pathtoapp/web/user`
- Log in as admin using `neo/neo` (change it!)
- Set up [module properties](PROPERTIES.md) as desired
- *Optional* - Update the nav links in your main layout *app/views/layouts/main.php*

```
// app/views/layouts/main.php
