【Laravel】artisanのaboutコマンドを解説

チートシート

Laravel 10.x以降のartisanの「about」コマンドを解説します。

Description

アプリケーションについての基本情報を表示します。

Usage

php artisan about [--only [ONLY]] [--json]
Bash

Options

オプション省略形必須説明
only--表示するセクション / The section to display
json--情報をJSONとして出力 / Output the information as JSON

Example

no options

envやキャッシュ、ドライバーの情報が出てきます。
設定が間違っていないか確認してみることをお勧めします。
間違っている場合は、エラーが出ていたり、値が異なったりしているので、とりあえず確認しておきましょう。

php artisan about
Bash
出力結果
  Environment ......................................................................................................................................
  Application Name .......................................................................................................................... My App
  Laravel Version ........................................................................................................................... 10.4.1
  PHP Version ................................................................................................................................ 8.2.5
  Composer Version ........................................................................................................................... 2.5.5
  Environment ................................................................................................................................ local
  Debug Mode ............................................................................................................................... ENABLED
  URL .................................................................................................................................... localhost
  Maintenance Mode ............................................................................................................................. OFF

  Cache ............................................................................................................................................
  Config ................................................................................................................................ NOT CACHED
  Events ................................................................................................................................ NOT CACHED
  Routes ................................................................................................................................ NOT CACHED
  Views ..................................................................................................................................... CACHED

  Drivers ..........................................................................................................................................
  Broadcasting ................................................................................................................................. log
  Cache ....................................................................................................................................... file
  Database ................................................................................................................................... mysql
  Logs .............................................................................................................................. stack / single
  Mail ........................................................................................................................................ smtp
  Queue ....................................................................................................................................... sync
  Session ..................................................................................................................................... file

only

必要なセクションのみ表示します。
大文字小文字はどちらでも大丈夫なようです。

php artisan about --only=cache
Bash
出力結果
  Cache ............................................................................................................................................
  Config ................................................................................................................................ NOT CACHED
  Events ................................................................................................................................ NOT CACHED
  Routes ................................................................................................................................ NOT CACHED
  Views ..................................................................................................................................... CACHED

json

設定をJSON形式で出力します。onlyとも組み合わせて指定可能です。

php artisan about --only=cache --json
Bash
出力結果
{"cache":{"config":"NOT CACHED","events":"NOT CACHED","routes":"NOT CACHED","views":"CACHED"}}

Source

10.x

framework/src/Illuminate/Foundation/Console/AboutCommand.php at 11.x · laravel/framework
The Laravel Framework. Contribute to laravel/framework development by creating an account on GitHub.

11.x

framework/src/Illuminate/Foundation/Console/AboutCommand.php at 11.x · laravel/framework
The Laravel Framework. Contribute to laravel/framework development by creating an account on GitHub.

コメント

タイトルとURLをコピーしました