@php
if($item->type == \App\Models\Item::DIGITAL){
$title = $item->digital_item->name;
}else{
$title = $item->title;
}
@endphp
{{$title}}
@if($item->type == \App\Models\Item::DIGITAL)
You will get: {{$item->quantity}}
@else
Available: {{$item->stock}}
@endif
{{--
--}}
@php
// Split the text into an array of words
$words = explode(' ', strip_tags($item->description));
// Define the word limit
$wordLimit = 10;
// Determine if the text exceeds the word limit
$excerpt = count($words) > $wordLimit ? implode(' ', array_slice($words, 0, $wordLimit)) . '...' : $item->description;
@endphp
{{ $excerpt }}