This commit is contained in:
Paolo A
2024-08-13 13:44:16 +00:00
parent 1bbb23088d
commit e796d76612
4001 changed files with 30101 additions and 40075 deletions

7
vendor/laravel/framework/src/Illuminate/Http/Response.php vendored Normal file → Executable file
View File

@@ -7,6 +7,7 @@ use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Contracts\Support\Jsonable;
use Illuminate\Contracts\Support\Renderable;
use Illuminate\Support\Traits\Macroable;
use InvalidArgumentException;
use JsonSerializable;
use Symfony\Component\HttpFoundation\Response as SymfonyResponse;
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
@@ -41,6 +42,8 @@ class Response extends SymfonyResponse
*
* @param mixed $content
* @return $this
*
* @throws \InvalidArgumentException
*/
public function setContent($content)
{
@@ -53,6 +56,10 @@ class Response extends SymfonyResponse
$this->header('Content-Type', 'application/json');
$content = $this->morphToJson($content);
if ($content === false) {
throw new InvalidArgumentException(json_last_error_msg());
}
}
// If this content implements the "Renderable" interface then we will call the