How to add a custom static method? #576
blueridgemountains1
started this conversation in
General
Replies: 1 comment
-
Not entirely sure how a collection is returned? As for not automatically calling methods, we only do this with static methods starting with from. So, creating a method called createFromSomething() should work. |
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 migrated from the dto package to the laravel-data package.
I want a custom static method
However, I cannot call
PostmarkResponse::fromSingleResponse
because I get the errorTypeError: Spatie\LaravelData\Resolvers\DataFromSomethingResolver::createFromCustomCreationMethod(): Return value must be of type ?Spatie\LaravelData\Contracts\BaseData, Illuminate\Support\Collection returned
How can I create a custom static method without the
createFromCustomCreationMethod
method firing?Beta Was this translation helpful? Give feedback.
All reactions