This module allows you to maintain users., (*1)
Download or checkout (SVN/Git) from https://github.com/marsoltys/yii2user and unpack files in your protected/modules/user, (*2)
composer require "marsoltys/yii2user:*",
Change your config web.php: #... 'modules'=>[ #... 'user' => [ 'class' => 'marsoltys\yii2user\Module', # OPTIONALLY YOU CAN CONFIGURE THESE PROPERTIES #'userClass' => 'marsoltys\yii2user\components\User', # User component class, you can change this to be your own class but it must be extended from class provided in this comment #'identityClass' => 'marsoltys\yii2user\models\User', # User Identity class, you can change this to be your own class but it must be extended from class provided in this comment #'userModel' => 'marsoltys\yii2user\models\User', # User model class, you can change this to be your own class but it must be extended from class provided in this comment ], #... ],
Change your config console:, (*3)
return array( #... 'modules'=>[ #... 'user' => [ 'class' => 'marsoltys\yii2user\Module' ], #... ] #... );
Run console command:, (*4)
php yii migrate --migrationPath=@marsoltys/yii2user/migrations
Provide admin login, email and password in console when prompted., (*5)
Please note that "user" component will be configured through this User module. To configure user component classes please see comments in web.php config file of "Configure" section above, (*6)