Giter Site home page Giter Site logo

transformers's Introduction

Hi ๐Ÿ‘‹

I'm a senior engineer at @Rasayel. Based in Cairo, Egypt ๐Ÿ‡ช๐Ÿ‡ฌ

  • GDE in Web Technologies
  • โšก๏ธ Technologies I work with: JavaScript, TypeScript, Node.js, CSS, HTML, Vue.js, Nuxt.js, TailwindCSS
  • โœ๏ธ I blog about Vue.js, GraphQL and Frontend topics at logaretm.com
  • ๐ŸŽ™๏ธ I host Untyped and A Point of Vue podcast in Arabic.
  • ๐Ÿ“ญ Reach me via ๐Ÿค @logaretm or ๐Ÿ“ฉ Email.

transformers's People

Contributors

logaretm avatar

Stargazers

 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

transformers's Issues

tags option does not exists

Read thru your code and liked it :)
but getting error on php artisan vendor:publish --provider="Logaretm\Transformers\Providers\TransformerServiceProvider" --tags="config"

[Symfony\Component\Console\Exception\RuntimeException]
The "--tags" option does not exist.

running Laravel 5.4

nested relations

Hi, how would you set a specific transformation (multiple transformations feature) with pagination on a nested relation? Is this possible?

FatalThrowableError in Transformer.php line 230

The transformer using with() only works if there is at least one photo record for each product. If not the transformer fails.

   $transformer = Transformer::make(Product::class);

   $products = \App\Product::with('photos')->get();

  $transformer->with('photos')->transform($products);

The Product model relationship with the Photo model

    public function photos()
    {
        return $this->hasMany(Photo::class);
    }

Should a product in the products collection not have an attached image record for that specific product the following error is thrown:

FatalThrowableError in Transformer.php line 230:
Call to a member function transform() on null

The $transformer->with('photos')->transform($products) should allow for the products relationship with photos or tags etc, to have and empty array collection; for those products without photo records, and still return the product, photos collection.

Dynamic transformations dont work at all!

For some reason, followed the documentation in depth, seems like for my Accounts model which also has the transformer added in transformers.php config, still wont show me the transformed object.

Bug or what?

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.