@props(['type']) @switch($type) @case('belongsToManyRelations') @php $createMethod = 'createNewBelongsToManyRelation'; $deleteMethod = 'deleteBelongsToManyRelation'; @endphp @break @case('belongsToRelations') @php $createMethod = 'createNewBelongsToRelation'; $deleteMethod = 'deleteBelongsToRelation'; @endphp @break @default @endswitch Add Relation Display Field @if ($this->addFeature) In Add @endif @if ($this->editFeature) In Edit @endif Actions @foreach ($this->{$type} as $i => $v) {{$v['relationName']}} {{$v['displayColumn']}} @if ($this->addFeature) {{$v['inAdd'] ? 'Yes' : 'No'}} @endif @if ($this->editFeature) {{$v['inEdit'] ? 'Yes' : 'No'}} @endif Delete @endforeach