2021년 6월 21일 월요일

Top Laravel Eloquent Features You May Not Know.

 

1. Check if Model changed

2. Get original attributes

3. Get changed attributes

Note: Here you need to keep in mind that, you will only get changes back if you save it or sync the changes with syncChanges()

4. Custom deleted_at column

5. Save relationships and models

6. Reload fresh model

7. Reload existing model

8. Check if models are the same

9. Clone a model

10. Specify attributes in find() method

Finally…

댓글 없음:

댓글 쓰기