Console Commands
Commands with Arguments
class EmailSender
{
#[ConsoleCommand('sendEmail')]
public function execute(string $email, string $type): void
{
}
}Executing Command
bin/console sendEmail "[email protected]" "welcome"php artisan sendEmail "[email protected]" "welcome"$messagingSystem->runConsoleCommand(
'sendEmail',
[
"email" => "[email protected]",
"type" => "welcome"
]
)Commands with Options
Executing Command
Providing default values
Executing Command
Array of Options
Executing Command
Passing Services
Passing Message Headers
Executing Command
Database Transaction
Last updated
Was this helpful?