Hello all, it's possible to order the data belongs to other table?
I have 3 tables:
Reports / User / Category.
Category and User belongs to Reports, and reportsa hasMany Category and User
Now, my category controller have:
$category = Category::orderby('title')->findOrFail($id);
But i want to sort the resuts for name of user
@pankaspe It's only three lines but still very hard to read and understand because you have text, lists and code all mixed together with poor punctuation. Try to format and punctuate your text please. See the difference below.
Hello all, it's possible to order the data belongs to other table? I have 3 tables: Reports / User / Category. Category and User belongs to Reports, and reportsa hasMany Category and User Now, my category controller have: $category = Category::orderby('title')->findOrFail($id); But i want to sort the resuts for name of user
Hello all,
it's possible to order the data belongs to other table?
I have 3 tables:
Reports
User
Category
Category and User belongs to Reports, and reports hasMany Category and User.
Now, my category controller have: $category = Category::orderby('title')->findOrFail($id); but i want to sort the results for name of user.
@pankaspe you should really spend some time to look through the documentation, it will open more doors for you when you know what this awesome framework can do.