Laravel 命令

  1. 命令行爽Eloquent

     php artisan tinker
    

    这样爽的好处?可以看到返回的类型和执行sql

     App\Models\Ready_Sample_Model::all();
     select * from `ready_samples`
     => Illuminate\Database\Eloquent\Collection {#895
     all: [
    App\Models\Ready_Sample_Model {#896
      id: 2646,
      ....
    
  2. 新建Model

     K:HapLab_Laravel maizhikun$ php artisan make:model Disease_Type_Item_Model
     Models created successfully.
    
php

Comments