mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 20:24:44 +02:00
Don’t handle livewire
This commit is contained in:
parent
9fc46b9ae5
commit
6f8f5e2746
@ -3,6 +3,7 @@
|
|||||||
namespace App\Exceptions;
|
namespace App\Exceptions;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
|
use Filament\Notifications\Notification;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
@ -47,8 +48,18 @@ class DisplayException extends PanelException implements HttpExceptionInterface
|
|||||||
* and then redirecting them back to the page that they came from. If the
|
* and then redirecting them back to the page that they came from. If the
|
||||||
* request originated from an API hit, return the error in JSONAPI spec format.
|
* request originated from an API hit, return the error in JSONAPI spec format.
|
||||||
*/
|
*/
|
||||||
public function render(Request $request): JsonResponse|RedirectResponse
|
public function render(Request $request)
|
||||||
{
|
{
|
||||||
|
if (str($request->url())->contains('livewire')) {
|
||||||
|
Notification::make()
|
||||||
|
->title(static::class)
|
||||||
|
->body($this->getMessage())
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ($request->expectsJson()) {
|
if ($request->expectsJson()) {
|
||||||
return response()->json(Handler::toArray($this), $this->getStatusCode(), $this->getHeaders());
|
return response()->json(Handler::toArray($this), $this->getStatusCode(), $this->getHeaders());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user