dcasia / custom-relationship-field Goto Github PK
View Code? Open in Web Editor NEWEmulate HasMany relationship without having a real relationship set between resources
License: MIT License
Emulate HasMany relationship without having a real relationship set between resources
License: MIT License
Thank you, this is awesome!
/Tim
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!
closed by #11
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!
Hey Rafael,
as always great stuff!
How can we add pagination to the result?
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.
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.