5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Laravel】配列からEloquentモデルを生成する(newInstanceとhydrate)

Last updated at Posted at 2019-06-12

この記事は個人ブログに移行しました。最新情報はブログ版をご覧ください。

要点

  • やりたいこと — DBに保存せずに配列をEloquentモデルにしたい。
  • 普通にnewする — ただしテスト書きづらくなるのでオススメしない。
  • newInstanceを使う — ※makeでいいのかわかってない。makeはItemがインスタンス化されている場合は不要。

もっと詳しく

  • ブログではコード全文や補足資料を継続的に更新しています
  • 気になる点があればコメントください🙌
5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?