Skip to content

Commit c2c422b

Browse files
Changed to snake_case helper to Str::snake()
1 parent 606f245 commit c2c422b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Handlers/AbstractHandler.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace SMartins\Exceptions\Handlers;
44

55
use Exception;
6+
use Illuminate\Support\Str;
67
use InvalidArgumentException;
78
use Illuminate\Auth\AuthenticationException;
89
use Illuminate\Validation\ValidationException;
@@ -157,7 +158,7 @@ public function getDefaultPointer()
157158
*/
158159
public function getDefaultTitle()
159160
{
160-
return snake_case(class_basename($this->exception));
161+
return Str::snake(class_basename($this->exception));
161162
}
162163

163164
/**

src/Handlers/ModelNotFoundHandler.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace SMartins\Exceptions\Handlers;
44

5+
use Illuminate\Support\Str;
56
use SMartins\Exceptions\JsonApi\Error;
67
use SMartins\Exceptions\JsonApi\Source;
78
use Illuminate\Database\Eloquent\ModelNotFoundException;
@@ -35,7 +36,7 @@ public function handle()
3536
return (new Error)->setStatus(404)
3637
->setCode($this->getCode('model_not_found'))
3738
->setSource((new Source())->setPointer('data/id'))
38-
->setTitle(snake_case(class_basename($this->exception)))
39+
->setTitle(Str::snake(class_basename($this->exception)))
3940
->setDetail($detail);
4041
}
4142

0 commit comments

Comments
 (0)