Giter Site home page Giter Site logo

Comments (4)

evan108108 avatar evan108108 commented on June 27, 2024

👍 this is one that we should add for sure.

from restfullyii.

evan108108 avatar evan108108 commented on June 27, 2024

@blitzjs I have updated RESTFullYii and now you can do things like this:

        $this->onRest('model.hidden.properties', function() {
            return ['password', 'id', '*.title', 'posts.id', '*.website'];
        });

        $this->onRest('model.visible.properties', function() {
            return ['username', 'email', 'posts.id', '*.title', 'profile.website'];
        });

The '*" is a wildcard that will act on all relations. I hope this helps and thanks again for the suggestion!

from restfullyii.

blitzjs avatar blitzjs commented on June 27, 2024

Thanks for addressing this so quickly!

from restfullyii.

Dhineshtyr avatar Dhineshtyr commented on June 27, 2024

@evan108108 is it possible to hide overrided model's attribute. for example,

$this->onRest('model.company.override.attributes', function($model) {
    return array_merge($model->attributes, ['profile' => $model->profile]);
});

$this->onRest('model.hidden.properties', function() {
    return ['company.profile.logo'];
});

from restfullyii.

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.