【Laravel】artisanのmodel:showコマンドを解説

model:show チートシート

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

Description

Eloquentモデルに関する情報を表示します。

Usage

php artisan model:show [--database [DATABASE]] [--json] [--] <model>

Arguments

引数必須説明
model必須表示するEloquentモデル

Options

オプション省略形必須説明
database--使用するデータベース接続
json--JSONで出力する

Example

no options

php artisan model:show User
  App\Models\User ..................................................................................................................................  
  Database ................................................................................................................................... mysql  
  Table ...................................................................................................................................... users  

  Attributes ........................................................................................................................... type / cast  
  id increments, unique ...................................................................................................... bigint unsigned / int  
  name fillable ........................................................................................................................ string(255)  
  email unique, fillable ............................................................................................................... string(255)  
  email_verified_at nullable ................................................................................................... datetime / datetime  
  password fillable, hidden ............................................................................................................ string(255)  
  remember_token nullable, hidden ...................................................................................................... string(100)  
  created_at nullable .......................................................................................................... datetime / datetime  
  updated_at nullable .......................................................................................................... datetime / datetime  

  Relations ........................................................................................................................................  
  tokens MorphMany ............................................................................................. Laravel\Sanctum\PersonalAccessToken  
  notifications MorphMany ............................................................................ Illuminate\Notifications\DatabaseNotification  

  Observers ........................................................................................................................................  

Source

10.x

framework/src/Illuminate/Database/Console/ShowModelCommand.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/Database/Console/ShowModelCommand.php at 11.x · laravel/framework
The Laravel Framework. Contribute to laravel/framework development by creating an account on GitHub.

コメント

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