Coder Social home page Coder Social logo

flattable's People

Contributors

tkeer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

cristiansitov

flattable's Issues

Update to Laravel 9/10

Just come across this package and it looks very helpful, but it's stuck at Laravel 8. Could it be updated to support up to Laravel 10? Thanks.

Not working on php 8.* due to the requirement incompatible.

I got this error when trying to require version 2 of the package

[InvalidArgumentException]                                                                                                           
  Package tkeer/flattable at version 2 has a PHP requirement incompatible with your PHP version, PHP extensions and Composer version:  
    - tkeer/flattable v2.0 requires php ^7.3 which does not match your installed version 8.0.10.      

Issue with callback

I was trying to use the callback to get some of the columns. I removed a lot of the other columns here for readability. Despite the function returning an array, I receive this error when running the fill command:

[2021-10-06 22:24:29] local.ERROR: array_values() expects parameter 1 to be array, object given {"exception":"[object] (ErrorException(code: 0): array_values() expects parameter 1 to be array, object given at /www/vendor/tkeer/flattable/src/Builders/ChangesBuilderHelper.php:129)

It seems I implemented it correctly per the documentation. Did I miss something?

public function flattableConfig() {
    return [
        [
            'columns' => [
                'organization_asset_id' => 'id',
            ],
            'type' => 'primary',
            'wheres' => [
                'organization_asset_id' => 'id',
            ],
            'flattable' => 'flat_organization_assets',
            'changes' => [
                'supplier_id' => [
                    'columns' => function (Supplier $supplier): array
                    {
                        return [
                            'supplier_id' => $supplier->exists ? $supplier->id : null,
                            'supplier_country_name' => $supplier->organization->headquarters->exists
                                ? $supplier->organization->headquarters->country->name : null,
                            'supplier_country_code' => $supplier->organization->headquarters->exists
                                ? $supplier->organization->headquarters->country->iso3 : null
                        ];
                    },
                    'wheres' => [
                        'id' => 'supplier_id'
                    ],
                    'table' => 'suppliers'
                ]
            ]
        ]
    ];
}

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.