mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-03-31 15:07:47 +01:00
Merge pull request #169 from php-flasher/issue-toastr-42
fix: Preserve original response content when injecting Flasher assets
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user