Merge pull request #169 from php-flasher/issue-toastr-42

fix: Preserve original response content when injecting Flasher assets
This commit is contained in:
Younes ENNAJI
2024-01-21 18:28:07 +01:00
committed by GitHub
+10
View File
@@ -75,6 +75,16 @@ final class Response implements ResponseInterface
*/
public function setContent($content)
{
$original = null;
if ($this->response instanceof \Illuminate\Http\Response && $this->response->getOriginalContent()) {
$original = $this->response->getOriginalContent();
}
$this->response->setContent($content);
// Restore original response (eg. the View or Ajax data)
if ($original) {
$this->response->original = $original;
}
}
}