Skip to content
Discussion options

You must be logged in to vote

You can add the following in App\Providers\NovaServiceProvider.

use Illuminate\Console\Command;
use Laravel\Nova\Nova;
use Laravel\Nova\Util;

Nova::createUserUsing(
    function (Command $command) {
        return [
            $command->ask('Name'),
            $command->ask('Email Address'),
            $command->secret('Password'),
            $command->ask('Username', null),
        ];
    },
    function ($name, $email, $password, $username) {
        $model = Util::userModel();

        return tap((new $model())->forceFill([
            'name' => $name,
            'email' => $email,
            'password' => Hash::make($password),
            'username' => $username,
            'p…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@connecteev
Comment options

Answer selected by connecteev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #5835 on August 24, 2023 04:44.