Skip to content

Instantly share code, notes, and snippets.

@bryandidur
Last active August 27, 2019 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bryandidur/e5cc90347b9250a5827d82c0d9e0a0f6 to your computer and use it in GitHub Desktop.
Save bryandidur/e5cc90347b9250a5827d82c0d9e0a0f6 to your computer and use it in GitHub Desktop.
Examples on how to schedule Laravel commands passing arguments & options

Passing arguments

$schedule->command('namespace:command-name', ['arg1', 'arg2'])->everyMinute();

Passing options

$schedule->command('namespace:command-name', ['--option1', '--option2'])->everyMinute();

Auto scheduling (The command scheduling itself)

$schedule->command($this->name, ['arg1', --option1'])->everyMinute();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment