Commit 0ef435a
[5.4] Check if Collection is empty and prevent exception on fresh method. (#19671)
* Add fresh method on Eloquent/Collection.
* Rewrite completely the method to avoid multiple database calls.
Add full tests for Model::fresh() and Collection::fresh() methods.
* Update tests for php5.6 and Carbon v1.20.0
* Check if collection is empty and prevent exception.
* styleCI1 parent 05060b1 commit 0ef435a
File tree
2 files changed
+10
-0
lines changed- src/Illuminate/Database/Eloquent
- tests/Database
2 files changed
+10
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
149 | 153 | | |
150 | 154 | | |
151 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
360 | 366 | | |
361 | 367 | | |
362 | 368 | | |
| |||
0 commit comments