Ayuda general de Laravel-crear un controlador
Ayuda general de Laravel
php artisan helpEsto muestra una lista de todos los comandos disponibles, organizados por categorías.
2. Ayuda para un comando específico
php artisan help make:controllerO también puedes usar:
php artisan make:controller --helpEsto te mostrará:
Description:
Create a new controller class
Usage:
make:controller [options] [--] <name>
Arguments:
name The name of the controller class
Options:
-e, --env[=ENV] The environment the command should run under
-f, --force Create the class even if the controller already exists
--resource Generate a resource controller class
--api Generate an API resource controller class
--invokable Generate a single action controller
--requests Generate form request classes (only with --resource)
--parent[=PARENT] Parent model name (only with --resource)
--model[=MODEL] Model name (only with --resource)
--test[=TEST] The test class name
--pest[=PEST] The test class name (Pest)
-h, --help Display help for the given command
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi|--no-ansi Force (or disable --no-ansi) ANSI output
-n, --no-interaction Do not ask any interactive question
--env[=ENV] The environment the command should run under
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug3. Ver opciones de un comando sin ejecutarlo
php artisan make:controller -hEs lo mismo que --help pero más corto.
4. Ayuda para migraciones
php artisan help make:migrationMuestra:
Description:
Create a new migration file
Usage:
make:migration [options] [--] <name>
Arguments:
name The name of the migration
Options:
--create[=CREATE] The table to be created
--table[=TABLE] The table to migrate
--path[=PATH] The location where the migration file should be created
--realpath Indicate any provided migration file paths are pre-resolved absolute paths
--fullpath Output the full path of the migration
-f, --force Create the class even if the migration already exists5. Ejemplos prácticos
| Quieres saber... | Comando |
|---|---|
| Todos los comandos | php artisan help |
| Cómo crear un controlador | php artisan help make:controller |
| Cómo crear un modelo | php artisan help make:model |
| Cómo crear una migración | php artisan help make:migration |
| Cómo crear un seeder | php artisan help make:seeder |
| Cómo crear un FormRequest | php artisan help make:request |
| Cómo crear una factory | php artisan help make:factory |
Opciones del comando migrate | php artisan help migrate |
Opciones del comando serve | php artisan help serve |
6. Comandos útiles para recordar
# Ver todos los comandos disponibles
php artisan list
# Ver solo los comandos make:*
php artisan list make
# Ver solo los comandos de migración
php artisan list migrate
# Buscar un comando específico
php artisan list | grep controller
Comentarios
Publicar un comentario