I have the following code:
Incident::where('id','<','35')->with('priority')->paginate(15);
Right now this returns the following: ID, title, description, priority_id and the priority object.
I would like to retrieve only ID, title and the priority object, without description nor priority_id but I want them in a specific order, like this: ID, priority and title.
But when I do the following:
Incident::where('id','<','5')->with('priority')->paginate(15, array('id', 'priority', 'title'));
I get an error saying column incidents.priority not found.
Is there any way to select only the columns I want and in the order I want them when one of them is referenced through a FK?
Thank you!