CodeIgniter-MY_Model
CodeIgniter-MY_Model copied to clipboard
Unable to pull multiple with=>relation for some joined table?
I have 4 tables... vehicles, service_logs, items, receipts I want to pull a vehicle along with all it's service logs and all of the service log's items and receipts. A vehicle has many service logs. A service log has a many receipts and many items.
$this->vehicle->with_service_logs([ 'with' => [ 'relation' => 'items' ] ])->get(1)
The above works fine but I still need to get the receipts related to the service_log too. How do I do that? I tried setting 'relation' to an array of relationship names but that didn't work. Is there a way to do that?