You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `table` method makes it easy to correctly format multiple rows / columns of data. Just pass in the headers and rows to the method. The width and height will be dynamically calculated based on the given data:
For long running tasks, it could be helpful to show a progress indicator. Using the output object, we can start, advance and stop the Progress Bar. You have to define the number of steps when you start the progress, then advance the Progress Bar after each step:
@@ -285,23 +285,23 @@ For long running tasks, it could be helpful to show a progress indicator. Using
285
285
286
286
$this->output->progressFinish();
287
287
288
-
For more advanced options, check out the[Symfony Progress Bar component documentation](http://symfony.com/doc/2.7/components/console/helpers/progressbar.html).
288
+
想了解更多高级选项,请查看[Symfony Progress Bar component documentation](http://symfony.com/doc/2.7/components/console/helpers/progressbar.html).
289
289
290
290
<aname="registering-commands"></a>
291
-
## Registering Commands
291
+
## 注册命令
292
292
293
-
Once your command is finished, you need to register it with Artisan so it will be available for use. This is done within the `app/Console/Kernel.php` file.
Within this file, you will find a list of commands in the `commands` property. To register your command, simply add the class name to the list. When Artisan boots, all the commands listed in this property will be resolved by the [service container](/docs/{{version}}/container) and registered with Artisan:
Sometimes you may wish to execute an Artisan command outside of the CLI. For example, you may wish to fire an Artisan command from a route or controller. You may use the `call` method on the `Artisan` facade to accomplish this. The `call` method accepts the name of the command as the first argument, and an array of command parameters as the second argument. The exit code will be returned:
@@ -311,7 +311,7 @@ Sometimes you may wish to execute an Artisan command outside of the CLI. For exa
311
311
//
312
312
});
313
313
314
-
Using the `queue` method on the `Artisan`facade, you may even queue Artisan commands so they are processed in the background by your [queue workers](/docs/{{version}}/queues):
@@ -321,15 +321,15 @@ Using the `queue` method on the `Artisan` facade, you may even queue Artisan com
321
321
//
322
322
});
323
323
324
-
If you need to specify the value of an option that does not accept string values, such as the `--force` flag on the `migrate:refresh` command, you may pass a boolean `true`or`false`:
Sometimes you may wish to call other commands from an existing Artisan command. You may do so using the `call` method. This `call` method accepts the command name and an array of command parameters:
@@ -345,7 +345,7 @@ Sometimes you may wish to call other commands from an existing Artisan command.
345
345
//
346
346
}
347
347
348
-
If you would like to call another console command and suppress all of its output, you may use the `callSilent` method. The `callSilent` method has the same signature as the `call` method:
0 commit comments