Laravel relationship এ hasOneThrough এবং hasManyThrough এর পার্থক্য কী?

দুইটি সম্পর্কের মধ্যে পার্থক্য কী এবং কখন কোনটি ব্যবহার করবো?
1 Answer
Answered by Ibrahim | 1 month ago

hasOneThrough একটি মডেল থেকে অপর একটি মডেল পর্যন্ত single রেকর্ড access করে, আর hasManyThrough multiple রেকর্ড access করে। যেমন: Country → Users → Posts; Country::with("posts") এর ক্ষেত্রে hasManyThrough ব্যবহার করা হয়।

Sign up or log in