Comments (14)
@topclaudy maybe I fix it in my project and submit it here to help people to avoid the issue, but why should this be done by me, I don't understand to be honest. I thought this is your package and you try to maintain this, provide a quality and functional code.
from compoships.
@miqoo1996 It's open source and contributions are welcomed. If you have the solution to a problem just submit a PR like other contributors and I will gladly merge it when I have a chance. I can't work on that for the moment (I'm actually replying to you from my phone). Maintainers are not full time invested in their packages, especially on weekends.
from compoships.
So I tried to open the PR but it seemed that I didn't have access to it.
You have to make a fork, then make your fix on that fork, and later do the PR, don't forget test with PHPUnit
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND
@miqoo1996 read https://opensource.org/licenses/MIT
but why should this be done by me
Because open source grows with the help of the community and that's why we can all do PR, you are not obliged to collaborate but it would be selfish if you know how to fix something for everyone
so, that's why it's free of charge, the author cannot spend 24/7 troubleshooting third-party problems
I appreciate and thanks @topclaudy & collaborators for maintaining support of this code
from compoships.
Issue is closed!
from compoships.
you have to include the primary key columns
yes, always, also inside the with
, without the keys, laravel cannot bind the relation
from compoships.
@miqoo1996 any news?
from compoships.
The problem is that the package ignores the with() function and it's the same if I don't use the with(). It does select * for every row for any relation instead of doing join query, or if you use whereIn, it does SQL selects for every condition.
from compoships.
@miqoo1996 Can you please PR the fix?
from compoships.
@topclaudy did you mean open a PR?
So I tried to open the PR but it seemed that I didn't have access to it.
from compoships.
Implement the fix and submit a pull request
from compoships.
I'm experiencing the same issue, in the query that's executed, it checks that the columns are NULL instead of their correct values, my code below...
CoachingRecommendation::with(['driver' => function ($query) use ($user, $driverStatus) {
$query->withinUserLocations($user);
$query->where('status', $driverStatus ?? 'Active');
}])
Which creates the query
SELECT *
FROM `drivers`
WHERE (
(
`drivers`.`company` IS NULL
and `drivers`.`employee_number` IS NULL
)
)
and (`location1` in ('UK'))
and (
`status` = 'Active'
)
I'll try to look into it and open a PR, although my knowledge with the internals of Eloquent is limited so I'm not sure I'll be able to solve it.
from compoships.
@keironlowe-edriving it does not seem to me that it is the same problem, it seems that the model has the relation fields as null, for some reason it is not locating them or it is not bringing them from the db
from compoships.
You're right it's not the same issue, but there is an issue with using select
. My code example was a reduced version, in the proper one I was also using selecting a raw SQL count, and it seems when using select, you have to include the primary key columns, otherwise they'll be null.
In my case, it turns out I didn't need with
, so I don't have the issue anymore.
from compoships.
@PaolaRuby I closed the issue for now. I'll make a PR when I have time. Now it'd be better to keep this closed.
Thanks!
from compoships.
Related Issues (20)
- Using `OR` instead of `AND` in the association HOT 6
- HasOne results to an error HOT 7
- Invalid input syntax for type uuid HOT 1
- Support more than nth columns HOT 1
- Relationship on string values HOT 1
- Doesn't Work In Laravel ^8.40 HOT 4
- Latest update (2.1.3) does not seem to allow DB:raw() for me as examples have shown HOT 1
- stripos() expects parameter 1 to be string, array given HOT 2
- is there gonna be Laravel 10.x support? HOT 3
- Future HOT 7
- Version conflict when test with Laravel 10 HOT 8
- Factory relationships support. Error: [Illegal offset type] HOT 2
- Possible/How to support sync, attach, detach? HOT 1
- Laravel upgrade - Cannot access distant relations anymore HOT 4
- Where not working HOT 1
- How to use that package in laravel 10 version ?
- Call to undefined method Awobaz\Compoships\Database\Query\Builder::getDb() HOT 1
- Error when using a column for which the model specifies cast to Enum HOT 1
- Integration with Eloquent Eager Limit
- Relate two different foreign keys to single local key
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compoships.