Skip to content

Commit fbb6cb3

Browse files
committed
feat: support laravel11
1 parent da869ea commit fbb6cb3

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/Http/Exceptions/Handler.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace Jiannei\Response\Laravel\Http\Exceptions;
4+
5+
use Jiannei\Response\Laravel\Support\Traits\ExceptionTrait;
6+
7+
class Handler extends \Illuminate\Foundation\Exceptions\Handler
8+
{
9+
use ExceptionTrait;
10+
}

src/Providers/LaravelServiceProvider.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Illuminate\Support\ServiceProvider;
1515
use Jiannei\Response\Laravel\Contract\ResponseFormat;
16+
use Jiannei\Response\Laravel\Http\Exceptions\Handler;
1617
use Jiannei\Response\Laravel\Support\Format;
1718

1819
class LaravelServiceProvider extends ServiceProvider
@@ -21,6 +22,11 @@ public function register()
2122
{
2223
$this->setupConfig();
2324

25+
$this->app->singleton(
26+
\Illuminate\Contracts\Debug\ExceptionHandler::class,
27+
Handler::class
28+
);
29+
2430
$this->app->singleton(ResponseFormat::class, function ($app) {
2531
$formatter = $app->config->get('response.format.class');
2632
$config = $app->config->get('response.format.config');

0 commit comments

Comments
 (0)