Skip to content

how to add role at the time (php artisan make:filament-user) #15127

Answered by leandrocfe
hagiik asked this question in Help
Discussion options

You must be logged in to vote
php artisan make:command CustomUserCommand

app/Console/Commands/CustomUserCommand.php

namespace App\Console\Commands;

use Filament\Commands\MakeUserCommand;

class CustomUserCommand extends MakeUserCommand
{
    protected function getUserData(): array
    {
        return [
            ...parent::getUserData(),
            'role' => $this->choice('Role', ['admin', 'user'], 0),
        ];
    }
}

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@hagiik
Comment options

@leandrocfe
Comment options

Answer selected by hagiik
@hagiik
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants