I suppose I'll have to do
@if($item->attachedto_type=='Company')
@include('partials.companydetails',['company' => $item->company])
@elseif($item->attachedto_type=='Person')
@include('partials.persondetails',['person' => $item->person])
@else
@include('partials.chooseattached')
@endif
better yet
@if($item->attachedto_type)
@include('partials.'.$item->attachedto_type.'details',['company' => $item->company, 'person' => $item->person])
@else
@include('partials.chooseattached')
@endif
or
@if($item->attachedto_type)
@include('partials.'.$item->attachedto_type.'details',['details' => $item->attachedto])
@else
@include('partials.chooseattached')
@endif
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community