2017 © Pedro Peláez
 

library laravel-cli-create-user

An artisan command to create, list and remove users in a laravel application from the cli

image

boaideas/laravel-cli-create-user

An artisan command to create, list and remove users in a laravel application from the cli

  • Tuesday, November 14, 2017
  • by amosmos
  • Repository
  • 2 Watchers
  • 9 Stars
  • 417 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 12 Versions
  • 56 % Grown

The README.md

Easily create, list and remove Laravel users with a CLI command

Latest Version on Packagist Software License StyleCI Total Downloads, (*1)

Using this artisan command it's easy to create Laravel users from the CLI whenever you need them. If you want, it will even email the user their credentials., (*2)

The command will validate the user details using Laravel's regular validation engine (which means you can create your own rules). If you want, the command can create a random password for you., (*3)

We also added commands to list all existing users and to easily remove users., (*4)

Requirements

The package is based on the defaul User model that ships with Laravel, so it assumes you're using a model (you can name it anything you want) with name, email and password fields., (*5)

Installation

You can install the package via composer:, (*6)

composer require boaideas/laravel-cli-create-user

If you're installing the package on Laravel 5.5 or higher, you're done (The package uses Laravel's auto package discovery)., (*7)

If you're using Laravel 5.4 or less, add the BOAIdeas\CreateUser\CreateUserServiceProvider service provider to your providers array:, (*8)

// config/app.php

'providers' => [
    ...
    BOAIdeas\CreateUser\CreateUserServiceProvider::class,
];

Usage

Create a new user

From your CLI execute:, (*9)

php artisan user:create

You will be asked for the user's name, email and password, and then the user account will be created. If you choose, a random password will be created for you., (*10)

Input validation

Your input will be validated using Laravel's validation engine with Laravel's default user input rules (you can change the rules if you want)., (*11)

Email user credentials

You will be asked if you want to send an email to the newly created user with their credentials. If you do, the command will send a regular Laravel notification to the user's email, so make sure you've sert your app's mail settings., (*12)

The notification is using the default APP_NAME, APP_URL, MAIL_FROM_ADDRESS and MAIL_FROM_NAME so make sure they're set correctly., (*13)

List all existing users

From your CLI execute:, (*14)

php artisan user:list

You will be presented with a table of all existing users., (*15)

Remove a user (by ID)

From your CLI execute:, (*16)

php artisan user:remove {user_id}

The command will confirm that you want to remove that user and will remove it., (*17)

Configuration

By default, the package assumes your User model is called User and validates your model input with the default rules that Laravel uses for users creation., (*18)

If you want to change any of these settings, you can publish the config file with:, (*19)

php artisan vendor:publish --provider="BOAIdeas\CreateUser\CreateUserServiceProvider"

This is the content of the published config file:, (*20)

// config/createuser.php

return [
    /*
    * The class name of the user model to be used.
    */
    'model' => 'App\User',

    /*
    * The validation rules to check for user model input.
    */
    'validation_rules' => [
        'name' => 'string|max:255',
        'email' => 'string|email|max:255|unique:users',
        'password' => 'string|min:6',
    ],

];

Credits

Alternatives

License

The MIT License (MIT). Please see License File for more information., (*21)

The Versions

14/11 2017

dev-master

9999999-dev https://github.com/amosmos/laravel-cli-create-user

An artisan command to create, list and remove users in a laravel application from the cli

  Sources   Download

MIT

The Requires

 

database laravel email user eloquent cli artisan list create remove boa ideas laravel-create-user

20/10 2017

v1.2

1.2.0.0 https://github.com/amosmos/laravel-cli-create-user

An artisan command to create, list and remove users in a laravel application from the cli

  Sources   Download

MIT

The Requires

 

database laravel email user eloquent cli artisan list create remove boa ideas laravel-create-user

20/10 2017

dev-analysis-zRb1k7

dev-analysis-zRb1k7 https://github.com/amosmos/laravel-cli-create-user

An artisan command to create, list and remove users in a laravel application from the cli

  Sources   Download

MIT

The Requires

 

database laravel email user eloquent cli artisan list create remove boa ideas laravel-create-user

10/09 2017

v1.1

1.1.0.0 https://github.com/amosmos/laravel-cli-create-user

An artisan command to create, list and remove users in a laravel application from the cli

  Sources   Download

MIT

The Requires

 

database laravel email user eloquent cli artisan list create remove boa ideas laravel-create-user

10/09 2017

v1.0

1.0.0.0 https://github.com/amosmos/laravel-cli-create-user

An artisan command to create (and list) users in a laravel application from the cli

  Sources   Download

MIT

The Requires

 

database laravel user eloquent cli artisan list create boa ideas laravel-create-user

08/09 2017

v0.3.3

0.3.3.0 https://github.com/amosmos/laravel-cli-create-user

An artisan command to create (and list) users in a laravel application from the cli

  Sources   Download

MIT

The Requires

 

database laravel user eloquent cli artisan list create boa ideas laravel-create-user

23/08 2017

0.3.2

0.3.2.0 https://github.com/amosmos/laravel-cli-create-user

An artisan command to create users in a laravel application from the cli

  Sources   Download

MIT

The Requires

 

database laravel user eloquent cli artisan create boa ideas laravel-create-user

23/08 2017

0.3.1

0.3.1.0 https://github.com/amosmos/laravel-cli-create-user

An artisan command to create users in a laravel application from the cli

  Sources   Download

MIT

The Requires

 

database laravel user eloquent cli artisan create boa ideas laravel-create-user

23/08 2017

0.3

0.3.0.0 https://github.com/amosmos/laravel-cli-create-user

An artisan command to create users in a laravel application from the cli

  Sources   Download

MIT

The Requires

 

database laravel user eloquent cli artisan create boa ideas laravel-create-user

23/08 2017

0.2.1

0.2.1.0 https://github.com/amosmos/laravel-cli-create-user

An artusan command to create users in a laravel application from the cli

  Sources   Download

MIT

The Requires

 

database user eloquent cli artisan create boa ideas laravel-create-user

23/08 2017

0.2

0.2.0.0 https://github.com/amosmos/laravel-cli-create-user

An artusan command to create users in a laravel application from the cli

  Sources   Download

MIT

The Requires

 

database user eloquent cli artisan create boa ideas laravel-add-user

21/08 2017

0.1

0.1.0.0 https://github.com/amosmos/laravel-add-user

A command to add users to a laravel application from the cli

  Sources   Download

MIT

The Requires

 

database user eloquent boa ideas laravel-add-user