Simplify transformer logic

This commit is contained in:
DaneEveritt 2022-05-22 16:23:22 -04:00
parent f7fc67344e
commit 33bafe9277
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
6 changed files with 32 additions and 44 deletions

View file

@ -58,17 +58,11 @@ class DisplayException extends PterodactylException
*
* @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
* @return \Illuminate\Http\RedirectResponse
*/
public function render($request)
{
if ($request->expectsJson()) {
return response()->json(Handler::convertToArray($this, [
'detail' => $this->getMessage(),
]), method_exists($this, 'getStatusCode') ? $this->getStatusCode() : Response::HTTP_BAD_REQUEST);
}
Container::getInstance()->make(AlertsMessageBag::class)->danger($this->getMessage())->flash();
app(AlertsMessageBag::class)->danger($this->getMessage())->flash();
return redirect()->back()->withInput();
}