GithubHelp home page GithubHelp logo

dcasia / custom-relationship-field Goto Github PK

View Code? Open in Web Editor NEW
28.0 5.0 6.0 672 KB

Emulate HasMany relationship without having a real relationship set between resources

License: MIT License

Vue 17.23% JavaScript 11.25% PHP 71.51%
laravel nova custom-field relationship nova4

custom-relationship-field's People

Contributors

dependabot[bot] avatar littlemiaor avatar milewski avatar nw-b avatar tarpsvo 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

Watchers

 avatar  avatar  avatar  avatar  avatar

custom-relationship-field's Issues

WOW

Thank you, this is awesome!

/Tim

browser crash

Im using package in nova4 and resource crashes browser after some time.

image

image

after disabling field, problem dissapear

This doesn't seem to work for me... here are some things I've tried.

This works:

$query->where('id', '<', 100);

โ— This does not:

$query = DB::table('users')
            ->where('id', '<', 100);

return $query

This works:

$query = $query
            ->leftJoin('buyer_buyers_agent AS bba', 'bba.buyer_id', '=', 'users.id')

return $query

โ— This does not:

$query = $query
            ->leftJoin('buyer_buyers_agent AS bba', 'bba.buyer_id', '=', 'users.id')
            ->where('bba.buyer_id', '<', 100)

return $query

I was expecting to customize my query. Can I make any query? What are the limitations?

Thanks!

How do we use this with other models?

How would we use this with a relation other than the same model? Like for your example this only displays other clients on the client page. I'm trying to display another model that belongs to the resource being looked at that isn't related by eloquent. Thank you very much for this package!

Pagination

Hey Rafael,

as always great stuff!

How can we add pagination to the result?

Duplication of the CustomRelationshipField

Using CustomRelationshipField twice results in duplication of the first CustomRelationshipField e.g
CustomRelationshipField::make('Child Prefixes', 'children', self::class), CustomRelationshipField::make('Parent Prefixes', 'parents', self::class),

results in displaying the Child Prefixes Twice.

Trait collision with ConditionalContainer

Great work!

When using together with ConditionalContainer I get following trait collision

Trait method 'availableFields' will not be applied because it collides with 'HasConditionalContainer'

Is there a way to solve this?

After updated Nova package doesn't work

Hello

First of all, I congratulate you on a job well done.

Second I wanted to open this issue because after updating to the latest version of nova 4.29.5 the package unfortunately stops working.

I attach image with the error.

Screenshot 2023-11-12 alle 14 11 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.