Have you seen our video tutorials? Check 'em out!

Manually creating related stream entries

keevitaja - 1 month ago

Hello!

I have a similar stream with content types setup as it is in posts and pages module.

I need to manually create a new entry for the main stream and the related type content. I can easily insert primary model with

$advertModel->create($data);

but how do i create the related type entry?

ryanthompson - 1 month ago

Relationship type field types (multiple, relationship, polymorphic, file(s), and such) all provide normal laravel relations: https://laravel.com/docs/5.3/eloquent-relationships

When in doubt just remember.. Stream Entry models ARE Eloquent models!