Skip to content

Commit

Permalink
feat: support laravel11
Browse files Browse the repository at this point in the history
  • Loading branch information
jiannei committed Mar 13, 2024
1 parent da869ea commit fbb6cb3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Http/Exceptions/Handler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace Jiannei\Response\Laravel\Http\Exceptions;

use Jiannei\Response\Laravel\Support\Traits\ExceptionTrait;

class Handler extends \Illuminate\Foundation\Exceptions\Handler
{
use ExceptionTrait;
}
6 changes: 6 additions & 0 deletions src/Providers/LaravelServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use Illuminate\Support\ServiceProvider;
use Jiannei\Response\Laravel\Contract\ResponseFormat;
use Jiannei\Response\Laravel\Http\Exceptions\Handler;
use Jiannei\Response\Laravel\Support\Format;

class LaravelServiceProvider extends ServiceProvider
Expand All @@ -21,6 +22,11 @@ public function register()
{
$this->setupConfig();

$this->app->singleton(
\Illuminate\Contracts\Debug\ExceptionHandler::class,
Handler::class
);

$this->app->singleton(ResponseFormat::class, function ($app) {
$formatter = $app->config->get('response.format.class');
$config = $app->config->get('response.format.config');
Expand Down

0 comments on commit fbb6cb3

Please sign in to comment.