Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

salom

use IlluminateDatabaseEloquentRelationsMorphTo;
 
$activities = ActivityFeed::query()
    ->with(['parentable' => function (MorphTo $morphTo) {
        $morphTo->morphWith([
            Event::class => ['calendar'],
            Photo::class => ['tags'],
            Post::class => ['author'],
        ]);
    }])->get();
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #salom
ADD COMMENT
Topic
Name
2+3 =