Replies: 1 comment
-
You can always do app(DataConfig::class)->getDataClass(YOUR DATA CLASS HERE) and then find the correct property within the structure. Or just copy this into your project: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have an application that relies on the PHP decimal extension for accurate decimal arithmetic, and have created a transformer to allow
Decimal
objects to be used as data properties.I was looking to create a test for this transformer that verifies it is working correctly. I noticed the built-in transformers have tests, but they rely on a class (
Spatie\LaravelData\Tests\Factories\FakeDataStructureFactory
) that is seemingly not present on the release version of the package.Is there a recommended way for package-specific transformers to be tested? Mainly how to create the
DataProperty
parameter required by thetransform()
function.Beta Was this translation helpful? Give feedback.
All reactions