tinker

Laravel 5.4 Database Structure

Relationships model A: User protected $fillable = [ DBのカラム] public function messages) { return $this->hasMany(Message::class); } model B: Message protected $fillable = [ DBのカラム] foreign_key は登録しなくてOK public function users() …

Laravel tinker Basic Usage

テスト用データベースを作成 php artisan make:model Test -m php artisan migrate (phpmyadmin-ctl install) tinkerを起動 php artisan tinker tinker console内で... $test = App\Test::create(); => App\Test {#715 updated_at: "2017-05-08 05:43:30", c…