Skip to content

Commit

Permalink
[fix] name mapping in request data classes (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
joelbutcher authored Jan 28, 2025
1 parent c443938 commit 10e8622
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/Data/BaseData.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

namespace Cachet\Data;

use Spatie\LaravelData\Attributes\MapName;
use Spatie\LaravelData\Data;
use Spatie\LaravelData\Mappers\SnakeCaseMapper;

/**
* @template TKey of array-key
* @template TValue
*/
#[MapName(SnakeCaseMapper::class)]
abstract class BaseData extends Data
{
/**
Expand Down
4 changes: 2 additions & 2 deletions workbench/config/data.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@
* global strategy here, or override it on a specific data object.
*/
'name_mapping_strategy' => [
'input' => \Spatie\LaravelData\Mappers\SnakeCaseMapper::class,
'output' => \Spatie\LaravelData\Mappers\SnakeCaseMapper::class,
'input' => null,
'output' => null,
],

/**
Expand Down

0 comments on commit 10e8622

Please sign in to comment.