Coder Social home page Coder Social logo

Comments (7)

rubenvanassche avatar rubenvanassche commented on August 29, 2024

Could you please provide me a test which isn't working:

cannot reproduce this bug:

it('does not stop wrapping', function(){
    config()->set('data.wrap', 'data');

    class RecipeData extends Data
    {
        public string $name;
    }

    class BundleData extends Data
    {
        public function __construct(
            public readonly ?int $id,
            #[DataCollectionOf(RecipeData::class)]
            public readonly Optional|Lazy|DataCollection $recipes,
        ) {
        }
    }

    $without = \BundleData::from([
        'id' => 10,
        'recipes' => Lazy::create(fn() => \RecipeData::collection([
            ['name' => 'A'],
            ['name' => 'B'],
        ])->withoutWrapping()),
    ]);

    $with = \BundleData::from([
        'id' => 10,
        'recipes' => Lazy::create(fn() => \RecipeData::collection([
            ['name' => 'A'],
            ['name' => 'B'],
        ])),
    ]);

    dd(
        $without->include('recipes')->toResponse(request())->getData(),
        $with->include('recipes')->toResponse(request())->getData(),
    );
});

from laravel-data.

jumbophp avatar jumbophp commented on August 29, 2024

are you using 8.2 ?

from laravel-data.

rubenvanassche avatar rubenvanassche commented on August 29, 2024

Closing due inactivity

from laravel-data.

jumbophp avatar jumbophp commented on August 29, 2024

Why are you closing this due to inactivity

from laravel-data.

rubenvanassche avatar rubenvanassche commented on August 29, 2024

@goellner didn't react since the 9th Januari

from laravel-data.

jumbophp avatar jumbophp commented on August 29, 2024

I'm intrested in this because his problem i had it only on 8.2

from laravel-data.

rubenvanassche avatar rubenvanassche commented on August 29, 2024

I'm using PHP 8.2 and the test I've provided above still works, please provide me a test which demonstrates this feature is not working and then we can take a further look.

from laravel-data.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.