Skip to content

Commit

Permalink
Make Model::fresh convert multiple args into array and pass to with().
Browse files Browse the repository at this point in the history
…closes #13933 (#13950)
  • Loading branch information
themsaid authored and taylorotwell committed Jun 11, 2016
1 parent 7817197 commit 43808e3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Illuminate/Database/Eloquent/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,10 @@ public function fresh($with = [])
return;
}

if (is_string($with)) {
$with = func_get_args();
}

$key = $this->getKeyName();

return static::with($with)->where($key, $this->getKey())->first();
Expand Down

0 comments on commit 43808e3

Please sign in to comment.