Symfony Tutorial: FOSUserBundle Command Line Tools
Create a User
You can use the fos:user:create command to create a new user for your application. The command takes three arguments, the username, email, and password for the user you are creating.
For example if you wanted to create a user with username testuser, with email test@example.com and password p@ssword, you would run the command as follows.
If any of the required arguments are not passed to the command, an interactive prompt will ask you to enter them. For example, if you ran the command as follows, then you would be prompted to enter the email and password for the user you want to create.
There are two options that you can pass to the command as well. They are --super-admin and --inactive.
Specifying the --super-admin option will flag the user as a super admin when the user is created. A super admin has access to any part of your application. An example is provided below:
If you specify the --inactive option, then the user that you create will no be able to login until he is activated.
No comments
Post a Comment