<?php // Create an artist $artist = new Artists(); $artist->name = 'Shinichi Osawa'; $artist->country = 'Japan'; // Create an album $album = new Albums(); $album->name = 'The One'; $album->artist = $artist; // Assign the artist $album->year = 2008; // Save both records $album->save();
But when you have multiple modules and newArtists() is a new \Common\Models\Artists() the $album->artist no longer works. I have also tried $album->commonModelsArtists()
I have looked for examples but cannot find any. Any idea's?