I like how you didn't just show how to use it, but you also broke down the SQL query itself and explained how it works. Thanks!
@ogdevs2 жыл бұрын
i fucking love you and your tuts.. and please try to number your playlists
@Laratips2 жыл бұрын
Thanks.
@skpao082 жыл бұрын
Hello, I have a query regarding this method, then I explain my scenario: - I have the Sale model, which is related to the saleUser model. - Each sale has several users, classified by type, that is, a sale can have, for example, 3 users, seller, cashier and biller, therefore there would be 3 types of users for this sale. - In the hasOne relation if I use ofMany, the example condition where ('type', 'seller') does not bring me anything, because it applies this filter in the relation conditions and not in the group by ofMany How could I set the condition inside the ofMany method? Thanks in advance.
@Laratips2 жыл бұрын
You can have a look at this example on the documentation. laravel.com/docs/8.x/eloquent-relationships#advanced-has-one-of-many-relationships You can try passing empty array on the first parameter of ofMany method and a closure with the where condition as shown in the example. As I am on mobile. So I haven't tested it. You can try it.
@skpao082 жыл бұрын
@@Laratips thanks a lot. It works for me 😍😍😍
@Laratips2 жыл бұрын
Always happy to help 🙂
@bashardlaleh21102 жыл бұрын
please remove the music in background it's distracting thanks