📜  如何查看 laravel 中的所有工匠列表 - PHP (1)

📅  最后修改于: 2023-12-03 14:53:09.592000             🧑  作者: Mango

如何查看 Laravel 中的所有工匠列表

在 Laravel 中,有很多内置的工匠可以使用。这些工匠包括:

  • 命令行工具
  • 数据库迁移
  • 路由
  • 控制器
  • 中间件
  • 事件
  • 队列
  • 缓存
  • 文件存储
  • 邮件

我们可以使用 php artisan list 命令来查看所有可用的工匠列表。

php artisan list

该命令的输出将类似于以下内容:

$ php artisan list

Laravel Framework 8.x

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display help for the given command. When no command is given display help for the list command
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable 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 debug

Available commands:
  clear-compiled       Remove the compiled class file
  down                 Put the application into maintenance mode
  env                  Display the current framework environment
  help                 Display help for a command
  inspire              Display an inspiring quote
  list                 List commands
  migrate              Run the database migrations
  optimize             Cache the framework bootstrap files
  preset               Swap the front-end scaffolding for the application
  serve                Serve the application on the PHP development server
  tinker               Interact with your application
  up                   Bring the application out of maintenance mode
 app
  app:name             Set the application namespace
 auth
  auth:clear-resets    Flush expired password reset tokens
  auth:guard           Display the guard for a given user
  auth:make            Generate authentication scaffolding
  auth:migrate-users   Convert the user table to the 8.0 "jetstream" schema.
  auth:remove          Remove Laravel authentication
  auth:resolve         Resolve multiple guards via the user provider
 cache
  cache:clear          Flush the application cache
  cache:forget         Remove an item from the cache
  cache:table          Create a migration for the cache database table
 config
  config:cache         Create a cache file for faster configuration loading
  config:clear         Remove the configuration cache file
 db
  db:seed              Seed the database with records
  db:wipe              Drop all tables, views, and types
 event
  event:cache          Discover and cache the application's events and listeners
  event:clear          Clear all cached events and listeners
  event:generate       Generate the missing events and listeners based on registration
  event:list           List the application's events and listeners
 horizon
  horizon:assets       Publish the Horizon assets
  horizon:configure    Configure the Horizon environment
  horizon:purge        Purge the Horizon job queue
  horizon:supervisor   Start the Horizon supervisor process
  horizon:terminate    Terminate the current Horizon supervisor process
 key
  key:generate         Set the application key
 make
  make:cast            Create a new custom Eloquent cast class
  make:channel         Create a new channel class
  make:command         Create a new Artisan command
  make:component       Create a new view component class
  make:controller      Create a new controller class
  make:event           Create a new event class
  make:exception       Create a new custom exception class
  make:factory         Create a new model factory
  make:job             Create a new job class
  make:listener        Create a new event listener class
  make:mail            Create a new email class
  make:middleware      Create a new middleware class
  make:migration       Create a new migration file
  make:model           Create a new Eloquent model class
  make:notification    Create a new notification class
  make:observer        Create a new observer class
  make:policy          Create a new policy class
  make:provider        Create a new service provider class
  make:request         Create a new form request class
  make:resource        Create a new resource class
  make:rule            Create a new validation rule
  make:seeder          Create a new seeder class
  make:test            Create a new test class
 migrate
  migrate:fresh        Drop all tables and re-run all migrations
  migrate:install      Create the migration repository
  migrate:refresh      Reset and re-run all migrations
  migrate:reset        Rollback all database migrations
  migrate:rollback     Rollback the last database migration
 notification
  notification:table   Create a migration for the notifications table
 optimize
  optimize:clear       Remove the cached bootstrap files
 package
  package:discover     Rebuild the cached package manifest
 queue
  queue:batches-table  Create a migration for the batches database table
  queue:failed         List all of the failed queue jobs
  queue:failed-table   Create a migration for the failed queue jobs database table
  queue:flush          Flush all of the failed queue jobs
  queue:forget         Delete a failed queue job
  queue:listen         Listen to a given queue
  queue:restart        Restart queue worker daemons after their current job
  queue:retry          Retry a failed queue job
  queue:table          Create a migration for the queue jobs database table
  queue:work           Start processing jobs on the queue as a daemon
 route
  route:cache          Create a route cache file for faster route registration
  route:clear          Remove the route cache file
  route:list           List all registered routes
 schedule
  schedule:list        List the scheduled commands
  schedule:run         Run the scheduled commands
 schema
  schema:dump          Dump the given database schema
  schema:load          Load the given schema into the database
  schema:table         Create a migration for the given table
 session
  session:table        Create a migration for the session database table
 storage
  storage:link         Create the symbolic links configured for the application
 stub
  stub:publish         Publish all stubs that are available for customization
 vendor
  vendor:publish       Publish any publishable assets from vendor packages
 view
  view:cache           Compile all of the application's Blade templates
  view:clear           Clear all compiled view files

以上是所有可用工匠的列表,包括它们的命令名称和用法。

除了 php artisan list 命令外,我们还可以使用 php artisan help <command> 命令来获取有关特定命令的帮助信息。

例如,如果我们希望查看 make:model 命令的帮助信息,可以运行以下命令:

php artisan help make:model

将输出以下内容:

Description:
  Create a new Eloquent model class

Usage:
  make:model [options] [--] <name>

Arguments:
  name                  The name of the class

Options:
  -a, --all             Generate a migration, factory, and resource controller for the model
      --force           Create the class even if the model already exists
  -m, --migration       Create a new migration file for the model
  -f, --factory         Create a new factory for the model
  -c, --controller      Create a new controller for the model
      --api             Exclude the create and edit methods from the controller
  -r, --resource        Indicates if the generated controller should be a resource controller
  -p, --pivot           Indicates if the generated model should be a custom intermediate table model
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable 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 debug

以上是如何查看 Laravel 中所有工匠列表的介绍。如有疑问,可查阅 Laravel 文档或使用 php artisan help 命令查看特定命令的帮助信息。

Markdown格式:

# 如何查看 Laravel 中的所有工匠列表

在 Laravel 中,有很多内置的工匠可以使用。这些工匠包括:

- 命令行工具
- 数据库迁移
- 路由
- 控制器
- 中间件
- 事件
- 队列
- 缓存
- 文件存储
- 邮件

我们可以使用 `php artisan list` 命令来查看所有可用的工匠列表。

```sh
php artisan list

该命令的输出将类似于以下内容:

$ php artisan list

Laravel Framework 8.x

Usage:
  command [options] [arguments]

...

除了 php artisan list 命令外,我们还可以使用 php artisan help <command> 命令来获取有关特定命令的帮助信息。

例如,如果我们希望查看 make:model 命令的帮助信息,可以运行以下命令:

php artisan help make:model

以上是如何查看 Laravel 中所有工匠列表的介绍。如有疑问,可查阅 Laravel 文档或使用 php artisan help 命令查看特定命令的帮助信息。