@extends('layouts.public') @section('title', 'Blog Lanyard Tangerang — Tips, Insight & Update') @if(request()->filled('q') || request()->integer('page', 1) > 1) @section('seo_noindex', '1') @endif @section('content') @php use App\Models\Post; use Illuminate\Support\Facades\Cache; $search = mb_substr(trim((string) request('q', '')), 0, 255); $escapedSearch = str_replace(['!', '%', '_'], ['!!', '!%', '!_'], $search); $page = max(1, (int) request('page', 1)); $perPage = 9; $query = Post::with('category', 'author') ->where('published', true); if ($search !== '') { $query->where(function ($q) use ($escapedSearch) { $term = "%{$escapedSearch}%"; $q->whereRaw("title LIKE ? ESCAPE '!'", [$term]) ->orWhereRaw("metaDescription LIKE ? ESCAPE '!'", [$term]) ->orWhereRaw("content LIKE ? ESCAPE '!'", [$term]); }); } $query->orderBy('createdAt', 'desc'); $total = $query->count(); $posts = $query->skip(($page - 1) * $perPage)->take($perPage)->get(); $hasMore = ($page * $perPage) < $total; $nextPage = $hasMore ? $page + 1 : null; // Fallback dummy data if ($posts->isEmpty() && !$search) { $posts = collect([ (object) [ 'title' => 'Pentingnya Lanyard untuk Keamanan Event Skala Besar', 'slug' => 'pentingnya-lanyard-event', 'metaDescription' => 'Lanyard bukan sekadar aksesoris, tapi instrumen keamanan penting untuk identifikasi peserta di event besar. Simak panduan lengkapnya.', 'featuredImage' => null, 'category' => (object) ['name' => 'Events'], 'author' => (object) ['name' => 'Tim Lanyard Tangerang'], 'createdAt' => now()->subDays(2), ], (object) [ 'title' => 'Tips Mendesain Lanyard yang Elegan untuk Brand Perusahaan', 'slug' => 'tips-mendesain-lanyard', 'metaDescription' => 'Pemilihan warna dan font yang tepat sangat krusial dalam mencerminkan identitas brand perusahaan Anda.', 'featuredImage' => null, 'category' => (object) ['name' => 'Branding'], 'author' => (object) ['name' => 'Tim Lanyard Tangerang'], 'createdAt' => now()->subDays(5), ], (object) [ 'title' => 'Tissue vs Polyester: Mana Bahan Lanyard Terbaik?', 'slug' => 'tissue-vs-polyester', 'metaDescription' => 'Membedah perbedaan kualitas, kenyamanan, dan harga antara material tissue dan polyester untuk lanyard custom.', 'featuredImage' => null, 'category' => (object) ['name' => 'Material'], 'author' => (object) ['name' => 'Tim Lanyard Tangerang'], 'createdAt' => now()->subDays(7), ], (object) [ 'title' => '5 Jenis Hook Lanyard yang Wajib Anda Ketahui', 'slug' => 'jenis-hook-lanyard', 'metaDescription' => 'Dari hook plastik standar hingga stainless steel premium, ini dia pilihan hook terbaik untuk lanyard Anda.', 'featuredImage' => null, 'category' => (object) ['name' => 'Aksesoris'], 'author' => (object) ['name' => 'Tim Lanyard Tangerang'], 'createdAt' => now()->subDays(9), ], (object) [ 'title' => 'Panduan Lengkap Sablon Lanyard: Teknik & Hasil Terbaik', 'slug' => 'panduan-sablon-lanyard', 'metaDescription' => 'Teknik sablon yang tepat menghasilkan warna tajam dan tahan lama untuk lanyard promosi perusahaan Anda.', 'featuredImage' => null, 'category' => (object) ['name' => 'Produksi'], 'author' => (object) ['name' => 'Tim Lanyard Tangerang'], 'createdAt' => now()->subDays(12), ], (object) [ 'title' => 'Mengapa Perusahaan Multinasional Memilih Lanyard Custom?', 'slug' => 'lanyard-custom-korporat', 'metaDescription' => 'Lanyard custom jadi bagian dari strategi branding korporat. Pelajari alasannya di sini.', 'featuredImage' => null, 'category' => (object) ['name' => 'Korporat'], 'author' => (object) ['name' => 'Tim Lanyard Tangerang'], 'createdAt' => now()->subDays(15), ], (object) [ 'title' => 'Ukuran Standar Tali ID Card: Panduan Lengkap', 'slug' => 'ukuran-tali-id-card', 'metaDescription' => 'Berapa ukuran ideal tali ID Card? Simak rekomendasi ukuran standar untuk berbagai kebutuhan.', 'featuredImage' => null, 'category' => (object) ['name' => 'Tips'], 'author' => (object) ['name' => 'Tim Lanyard Tangerang'], 'createdAt' => now()->subDays(18), ], (object) [ 'title' => 'Cetak Lanyard Custom untuk Seminar Kampus: Budget-Friendly', 'slug' => 'lanyard-seminar-kampus', 'metaDescription' => 'Tips hemat cetak lanyard custom untuk acara kampus tanpa mengorbankan kualitas.', 'featuredImage' => null, 'category' => (object) ['name' => 'Edukasi'], 'author' => (object) ['name' => 'Tim Lanyard Tangerang'], 'createdAt' => now()->subDays(21), ], (object) [ 'title' => 'Perbandingan Harga Lanyard Custom di Jabodetabek 2025', 'slug' => 'perbandingan-harga-lanyard', 'metaDescription' => 'Kami bandingkan harga cetak lanyard custom dari berbagai vendor di Jabodetabek. Simak hasilnya!', 'featuredImage' => null, 'category' => (object) ['name' => 'Review'], 'author' => (object) ['name' => 'Tim Lanyard Tangerang'], 'createdAt' => now()->subDays(25), ], ]); $total = $posts->count(); $hasMore = false; } $img = fn ($src) => \App\Support\AssetUrl::relative($src); @endphp {{-- Hero --}}

Blog

Update & Insight Lanyard

Artikel terbaru seputar lanyard custom, tips branding, tren event, dan panduan cetak untuk kebutuhan profesional Anda.

{{-- Search --}}
@if ($search) Hapus @endif

@if($search) @if($total > 0) Menampilkan {{ $posts->count() }} hasil untuk "{{ $search }}" @else Tidak ada artikel yang cocok untuk "{{ $search }}" @endif @else {{ $total > 0 ? "Menampilkan {$posts->count()} dari {$total} artikel" : 'Belum ada artikel tersedia' }} @endif

{{-- Blog Grid --}}
@if ($posts->isEmpty())
article

Artikel tidak ditemukan

Coba gunakan kata kunci yang berbeda.

@else
@foreach ($posts as $index => $post) @php $textOnly = trim(strip_tags($post->content ?? '')); $wordCount = $textOnly ? count(preg_split('/\s+/', $textOnly)) : 0; $readingTime = max(1, (int) ceil($wordCount / 200)); @endphp
{{-- Image --}} @if($post->featuredImage) {{ $post->title }} @else
article
@endif
{{-- Meta Row: Author Avatar, Name, Date, Reading Time --}}
@if(!empty($post->author->avatar)) {{ $post->author->name }} @else
{{ strtoupper(substr($post->author->name ?? 'Admin', 0, 1)) }}
@endif {{ $post->author->name ?? 'Tim Lanyard' }}
{{ \Carbon\Carbon::parse($post->createdAt)->translatedFormat('j M Y') }} • {{ $readingTime }} mins
{{-- Body Content --}}
{{-- Title --}}

{{ $post->title }}

{{-- Excerpt --}}

{{ $post->metaDescription ?: 'Baca selengkapnya tentang topik ini di blog Lanyard Tangerang.' }}

@endforeach
{{-- Pagination / Load More --}} @if ($hasMore) @endif @endif
@include('components.cta') @include('components.footer') @endsection