@php
$wrapText = function($text, $maxLength = 15) {
$words = explode(' ', $text);
$lines = [];
$currentLine = '';
foreach ($words as $word) {
if (strlen($currentLine . ' ' . $word) <= $maxLength) {
$currentLine = trim($currentLine . ' ' . $word);
} else {
$lines[] = $currentLine;
$currentLine = $word;
}
}
if (!empty($currentLine)) {
$lines[] = $currentLine;
}
return $lines;
};
$text = $tickets[0]->event_name;
$lines = $wrapText($text);
@endphp
@foreach($lines as $line)
{{ $line }}
@endforeach
{{ \Carbon\Carbon::parse($tickets[0]->date_event)->format('j F Y') }}
@php
$kata = $tickets[0]->address_event;
$wrapText = function($text, $maxLength = 20) {
$words = explode(' ', $text);
$lines1 = [];
$currentLine = '';
foreach ($words as $word) {
if (strlen($currentLine . ' ' . $word) <= $maxLength) {
$currentLine = trim($currentLine . ' ' . $word);
} else {
$lines1[] = $currentLine;
$currentLine = $word;
}
}
if (!empty($currentLine)) {
$lines1[] = $currentLine;
}
return $lines1;
};
$lines1 = $wrapText($kata);
@endphp
@foreach($lines1 as $line)
{{ $line }}
@endforeach
Organizer By
{{$tickets[0]->company_name}}