Skip to content

Commit 25b0303

Browse files
authored
Merge pull request #2 from karoldabro/fix/remove-handler-bind
Remove Hanlder bind
2 parents f052ac2 + 83f78af commit 25b0303

3 files changed

Lines changed: 17 additions & 2 deletions

File tree

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ composer require kdabrow/validation-codes
2525
```
2626

2727
Afterward, extend your `Exception\Handler` file with `Kdabrow\ValidationCodes\Handler`.
28+
```php
29+
<?php
30+
31+
namespace App\Exceptions;
32+
33+
class Handler extends \Kdabrow\ValidationCodes\Handler
34+
{
35+
36+
}
37+
```
2838

2939
## How It Works
3040

src/Providers/ValidationCodesProvider.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ public function register()
2828

2929
return $factory;
3030
});
31-
32-
$this->app->singleton(ExceptionHandler::class, Handler::class);
3331
}
3432

3533
public function boot()

tests/Helpers/ValidationCodesTestProvider.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,18 @@
22

33
namespace Kdabrow\ValidationCodes\Tests\Helpers;
44

5+
use Illuminate\Contracts\Debug\ExceptionHandler;
56
use Illuminate\Support\Facades\Validator;
67
use Illuminate\Support\ServiceProvider;
8+
use Kdabrow\ValidationCodes\Handler;
79

810
class ValidationCodesTestProvider extends ServiceProvider
911
{
12+
public function register()
13+
{
14+
$this->app->singleton(ExceptionHandler::class, Handler::class);
15+
}
16+
1017
public function boot(): void
1118
{
1219
$this->loadRoutesFrom(__DIR__.'/routes.php');

0 commit comments

Comments
 (0)