Комментарии:
I have a query here, why you put foreignPivotKey projects_id and relatedPivotKey users_id in the belongsToMany method? Shouldn’t it be, belongsToMany(User::class, 'user_id', 'id'),
Ответитьthanks, its a great help
ОтветитьThank you. Great as always
Ответить@PovilasKorop How can we order the results by field in pivot model relation? using the video example by managers name - `$user->pivot->manager->name`
ОтветитьYou don't know how much I needed this 😂 thank you so much
ОтветитьI tried this in Laravel 9 with three tables involved in the many to many relationship, Project / User / Role, and it worked!!! Thanks a lot
ОтветитьAbit confusing
ОтветитьThank you very much for this information💙
ОтветитьThanks a lot !!!! You help so much... I not understand english very well, but I follow your videos and then help me so much... Thank you
Ответитьthis video helped me so many times
Great video
Hi, why did you only define the relationship one way?
Have a video showing many-to-many relationship defined both directions (from Users and Projects)?
Thanks!!!
ОтветитьMust say I'm watching a while and a i bought the stuff - this one is by far one of the best, there's very limited content out there on this topic that explains it like this so many thanks!
ОтветитьThis is working fine but I am not able to see pivot result in controller response(not in blade). How I can achieve? And is it working fine with API?
ОтветитьHi. Can I get one(latest) record with belongsToMany?
ОтветитьJust realized that the manager() method in Invitation model can just have $this->users()->wherePivot($condition) logic.
Ответитьi feel like i can only understand eloquent relations by actually using them.
ОтветитьI knew nothing about pivot before I came here. Now I know how much I don't know. Still confused. That is all
UPDATE: nvm I get it now
you are the king. if you come to turkey i will buy you adana kebab.Thank you king:)
Ответитьawesome thank you!!
ОтветитьThis was incredibly useful, thank you! I was struggling to find a good detailed overview of how pivot tables work. The laravel documentation is not clear if you're not already familiar with them. I appreciate you!
ОтветитьHi, I'm having a hard time to relate 3 tables with eloquent. Product table, recie table and material table. How should I relate them if product has one recipe and within recipe has many materials?
ОтветитьOk, I thought I knew pivots, even complex ones, until I watched this. I always learn something from your videos. Truly inspirational! 👍
Ответитьhello how to join that manager_id using users table id to join pivot project_user?
Ответитьhow come you don't show the ProjectFactory? I'm wondering how to write that out.
ОтветитьHi! I have a question: are there an massive attach or massive sync in laravel?
ОтветитьThank you for your work and extremely useful content!!!!
Ответитьthank you my error has been resolved now
Ответитьyou explain very very very good , thank and God give you peace
ОтветитьThank you !!!!
ОтветитьI liked this before I even watched it as I already knew your video would help me! Thanks for such consistent high-quality content.
ОтветитьHello Sir, How to signup account on your Laravel Daily site?
I see only login.
Hello Sir, Can I know which tool are you using to view Database in your video?
Is it free or need to buy?
it's save my day. thanks so much
Ответитьcan I access manager() pivot model method from $project instance, i.e $project->pivot->manager?
ОтветитьBillurlarına sağlık be adam.
ОтветитьThank you for this video. I was wondering how to set a value for one (or more) of the columns in the pivot table while attaching. For example, when attaching a user to a project and set is_admin to 1 at the same time.
ОтветитьWhat if every project has multiple managers
Ответитьawesome
ОтветитьThere are auto labels inside brackets in migration file. "table, column etc.." What's that feature called? I'd like the same working in VSCode.
ОтветитьI had a problem using the pivot model in many-to-many relationships because the queries in the database used the table name different from what I had named in the varialbe $table in model pivot
Ответитьyou are a crack, my idol
Ответитьguys, this man is the best. Man thank you very much, you have saved me from a problem that I could not find how to solve it. Very good video and explained, it goes on so you will be much bigger than you are now.
Ответитьyou saving my life ❤❤
Ответитьthank you very much
Ответитьvery good and all, but you did not mention or show how to load with eagger loading the Belongs to Administrator, you load it from the view with $ project-> pivot-> administrator-> name and I understand that this is bad practice, I have tried to find the way to call the relationships that are in a pivot model but I have not had any luck, I only see that there are some packages for that, sorry for my English I speak Spanish.
Ответитьit would be great if i can see source code on github or other git sites :D
ОтветитьAnother great video . Brilliant examples. Thanks a lot.
Ответить