diff --git a/app/Http/Requests/BaseRequest.php b/app/Http/Requests/BaseRequest.php new file mode 100644 index 0000000..99e4b8d --- /dev/null +++ b/app/Http/Requests/BaseRequest.php @@ -0,0 +1,29 @@ +json)) { + $content = $this->getContent(); + + $parameters = Str::length($content) > static::JSON_MAX_LENGTH ? [] : (array) json_decode($content, true); + + $this->json = new ParameterBag($parameters); + } + + if (is_null($key)) { + return $this->json; + } + + return data_get($this->json->all(), $key, $default); + } +} diff --git a/public/index.php b/public/index.php index f3c2ebc..b9ac30b 100644 --- a/public/index.php +++ b/public/index.php @@ -1,7 +1,8 @@