From b9ef428f4fc8829c241c6193fb0361605a81a0aa Mon Sep 17 00:00:00 2001 From: Mohamed Said Date: Mon, 21 Aug 2017 10:24:25 +0200 Subject: [PATCH] Return the instance after refresh --- src/Illuminate/Database/Eloquent/Model.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Database/Eloquent/Model.php b/src/Illuminate/Database/Eloquent/Model.php index 00a20cfc9124..563628b3a76c 100644 --- a/src/Illuminate/Database/Eloquent/Model.php +++ b/src/Illuminate/Database/Eloquent/Model.php @@ -950,17 +950,19 @@ public function fresh($with = []) /** * Reload the current model instance with fresh attributes from the database. * - * @return void + * @return $this */ public function refresh() { if (! $this->exists) { - return; + return $this; } $this->load(array_keys($this->relations)); $this->setRawAttributes(static::findOrFail($this->getKey())->attributes); + + return $this; } /**