3

As the official docs, it doesn't mention about this a lot. App\Console\Commands\PullUsersCommand.php has a signature like:

protected $signature = 'pull:users {startTime} {endTime} {minutes=10} {--flag} {--star=}';

So, how to pass the parameters to it in App\Console\Kernel.php

1 Answer 1

6

You could call it in App\Console\Kernel.php like this:

$schedule->command('pull:users', [
    time(),  // captured with $this->argument('startTime') in command class.
    time(),  // captured with $this->argument('endTime') in command class.
    30,      // captured with $this->argument('minutes') in command class.
    '--flag',// should be without any value, just the option name, and would be captured by $this->option('minutes').
    '--star'=>12, // would be captured by $this->option('star').
])->daily();

It should be okay with Artisan::call facade too.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.