@if(isset($templateView) && view()->exists($templateView)) @php $templateContent = view($templateView, ['quotation' => $quotation])->render(); preg_match_all('/]*>(.*?)<\/style>/is', $templateContent, $styleMatches); $styles = !empty($styleMatches[1]) ? '' : ''; $bodyContent = $templateContent; if (preg_match('/]*>(.*?)<\/body>/is', $templateContent, $bodyMatches)) { $bodyContent = $bodyMatches[1]; } $bodyContent = preg_replace('/]*>(.*?)<\/script>/is', '', $bodyContent); @endphp {!! $styles !!} @endif @if(isset($bodyContent)) {!! $bodyContent !!} @else

Quotation {{ $quotation->quotation_number }}

Template not found.

@endif