Giter VIP home page Giter VIP logo

Comments (14)

miqoo1996 avatar miqoo1996 commented on July 2, 2024 4

@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.

topclaudy avatar topclaudy commented on July 2, 2024 4

@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.

erikn69 avatar erikn69 commented on July 2, 2024 3

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.

miqoo1996 avatar miqoo1996 commented on July 2, 2024 2

Issue is closed!

from compoships.

erikn69 avatar erikn69 commented on July 2, 2024 1

you have to include the primary key columns

yes, always, also inside the with, without the keys, laravel cannot bind the relation

from compoships.

PaolaRuby avatar PaolaRuby commented on July 2, 2024 1

@miqoo1996 any news?

from compoships.

miqoo1996 avatar miqoo1996 commented on July 2, 2024

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.

topclaudy avatar topclaudy commented on July 2, 2024

@miqoo1996 Can you please PR the fix?

from compoships.

miqoo1996 avatar miqoo1996 commented on July 2, 2024

@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.

topclaudy avatar topclaudy commented on July 2, 2024

Implement the fix and submit a pull request

from compoships.

keironlowe-edriving avatar keironlowe-edriving commented on July 2, 2024

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.

erikn69 avatar erikn69 commented on July 2, 2024

@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.

keironlowe-edriving avatar keironlowe-edriving commented on July 2, 2024

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.

miqoo1996 avatar miqoo1996 commented on July 2, 2024

@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)

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.