@foreach($templates->pluck('templateId')->toArray() as $template)
@endforeach
@foreach($models as $model)
@endforeach
@if($template_id_api)
@php
$selectedTemplate = $templates->firstWhere('templateId', $template_id_api);
@endphp
@php
function getInbetweenStrings($start, $end, $str){
$matches = array();
$regex = "/$start([a-zA-Z0-9_]*)$end/";
preg_match_all($regex, $str, $matches);
return $matches[1];
}
$str = $selectedTemplate['templateDesc'];
$str_arr = getInbetweenStrings('{{', '}}', $str);
@endphp
{{$selectedTemplate['templateDesc']}}