When to use relationship and when to joins for fetch data in laravel ?
I have little bit confusion between when to use relationship and when use joins for fetch data in laravel because both features results are same on such situations?
I rarely use joins and mostly use relationships. Joins are great as they can execute a single query across multiple tables, however they are often more complex queries than relationships produce. So often, it's faster and more efficient to run multiple simple queries than one larger complex one.
because both features results are same on such situations
This is incorrect.
Eloquent relations will result in additional queries, with related models nested as properties of the parent (in the context of the relationship) Eloquent model. Whenever you join, you are no longer working with discreet models. Aside from joins which aggregate some column(s) of a related table (sum, avg etc) or joins which get an attribute of what would otherwise be a hasOne/belongsTo related table, I tend to avoid using joins when I specifically want to work with models.