PHP code example of luilliarcec / laravel-user-commands

1. Go to this page and download the library: Download luilliarcec/laravel-user-commands library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

luilliarcec / laravel-user-commands example snippets




namespace App\Commands;

use Luilliarcec\UserCommands\Commands\CreateNewUserCommand as CreateNewUserCommandBase;

class CreateNewUserCommand extends CreateNewUserCommandBase
{
    protected function prepareForSave(): array
    {
        return $this->merge([
            'password' => Hash::make($this->data['password']),
            'username' => Username::make($this->data['name']),
        ]);
    }
}
bash
php artisan vendor:publish --provider="Luilliarcec\UserCommands\UserCommandsServiceProvider"
bash
php artisan user:create
bash
php artisan user:create --verified
bash
php artisan user:reset-password [email protected]
bash
php artisan user:reset-password larcec --field username
bash
php artisan user:delete [email protected]
bash
php artisan user:delete larcec --field username
bash
php artisan user:delete larcec --field username --force
bash
php artisan user:restore [email protected]
bash
php artisan user:restore larcec --field username
bash
php artisan user:create --permissions="user-create" --permissions="user-edit"