@extends('layouts.master') @section('title') Items @endsection @section('css') @endsection @section('content') @component('components.breadcrumb') @slot('li_1') Items @endslot @slot('title') List @endslot @endcomponent @include('partials.session')
ID | Title | Description | Images | Created At | Actions |
---|---|---|---|---|---|
{{$item->id}} | @php if($item->type == \App\Models\Item::DIGITAL){ $title = $item->digital_item->name; }else{ $title = $item->title; } @endphp {{$title}} | @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}} | {{$item->created_at->diffForHumans()}} |
|