@php $blogs = \App\Models\BlogPost::where('is_published', true) ->latest('published_at') ->take(10) ->get() ->map(function($blog) { return [ 'id' => $blog->id, 'title' => $blog->title, 'excerpt' => $blog->excerpt ?? \Illuminate\Support\Str::limit(strip_tags($blog->content), 80), 'image' => $blog->featured_image ? asset('storage/' . $blog->featured_image) : 'https://images.unsplash.com/photo-1486312338219-ce68d2c6f44d?q=80&w=2072&auto=format&fit=crop', 'url' => route('blog.show', $blog->slug), 'tempId' => $blog->id ]; }); if($blogs->isEmpty()) { // Fallback for demo $blogs = collect([ ['id' => 1, 'title' => 'Starting your Business', 'excerpt' => 'Learn the fundamentals of starting a successful business in 2026.', 'image' => 'https://images.unsplash.com/photo-1497215728101-856f4ea42174?q=80&w=2070&auto=format&fit=crop', 'url' => '#', 'tempId' => 1], ['id' => 2, 'title' => 'Tax Compliance 101', 'excerpt' => 'Everything you need to know about staying tax-compliant this year.', 'image' => 'https://images.unsplash.com/photo-1554224155-8d04cb21cd6c?q=80&w=2070&auto=format&fit=crop', 'url' => '#', 'tempId' => 2], ['id' => 3, 'title' => 'Scaling your Startup', 'excerpt' => 'Practical advice for founders looking to reach their next milestone.', 'image' => 'https://images.unsplash.com/photo-1559136555-9303baea8ebd?q=80&w=2070&auto=format&fit=crop', 'url' => '#', 'tempId' => 3], ]); } @endphp