We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✏️ Describe the bug When adding additional properties to a Data Object, they do not get wrapped by wrap().
↪️ To Reproduce Provide us a pest test like this one which shows the problem:
it('cannot wrap additional properties', function () { class UserData extends Data { public function __construct( public string $name, ) { } } dd(UserData::from(['name' => 'Ruben'])->additional(['role' => 'admin'])->wrap('data')); });
Assertions aren't required, a simple dump or dd statement of what's going wrong is good enough 😄
✅ Expected behavior I'm expecting this to produce
[ "data" => [ "name" => "Ruben", "rank" => "admin", ], ]
but instead, I get [ "data" => [ "name" => "Ruben", ], "rank" => "admin", ]
A similar thing happens when I add a with() method to the object.
🖥️ Versions
Laravel: v10.48.22 Laravel Data: 4.11.0 PHP: 8.2.20
The text was updated successfully, but these errors were encountered:
No branches or pull requests
✏️ Describe the bug
When adding additional properties to a Data Object, they do not get wrapped by wrap().
↪️ To Reproduce
Provide us a pest test like this one which shows the problem:
Assertions aren't required, a simple dump or dd statement of what's going wrong is good enough 😄
✅ Expected behavior
I'm expecting this to produce
but instead, I get
[
"data" => [
"name" => "Ruben",
],
"rank" => "admin",
]
A similar thing happens when I add a with() method to the object.
🖥️ Versions
Laravel: v10.48.22
Laravel Data: 4.11.0
PHP: 8.2.20
The text was updated successfully, but these errors were encountered: