protected function createDocument(array $fields) { $song = new Songs(); foreach ($fields as $name => $value) { $song->{$name} = $value; } return $song->save(); }