@if(app()->getLocale() === 'ar') {{ __('navigation.search_blog') }} @else {{ __('navigation.search_blog') }} @endif
@if(app()->getLocale() === 'ar') @else @endif
@if(app()->getLocale() === 'ar') {{ __('navigation.categories') }} @else {{ __('navigation.categories') }} @endif
@foreach($categories as $category) @if($category->{'slug_' . app()->getLocale()}) @if(app()->getLocale() === 'ar') {{ $category->name }} @else {{ $category->name }} @endif {{ $category->blogs_count ?? $category->blogs()->active()->count() }} @endif @endforeach
@if(app()->getLocale() === 'ar') {{ __('navigation.popular_posts') }} @else {{ __('navigation.popular_posts') }} @endif
@foreach($popularBlogs as $popular)
@if(app()->getLocale() === 'ar')
{{ Str::limit($popular->title, 50) }}
{{ $popular->views_count }}
{{ $popular->title }} @else {{ $popular->title }}
{{ Str::limit($popular->title, 50) }}
{{ $popular->views_count }}
@endif
@endforeach
@if(app()->getLocale() === 'ar') {{ __('navigation.recent_posts') }} @else {{ __('navigation.recent_posts') }} @endif
@php $recentBlogs = \App\Models\Blog::active()->recent()->limit(5)->get(); @endphp @foreach($recentBlogs as $recent)
@if(app()->getLocale() === 'ar')
{{ Str::limit($recent->title, 50) }}
{{ $recent->published_at->locale('ar')->diffForHumans() }}
{{ $recent->title }} @else {{ $recent->title }}
{{ Str::limit($recent->title, 50) }}
{{ $recent->published_at->diffForHumans() }}
@endif
@endforeach
@if(app()->getLocale() === 'ar') {{ __('navigation.popular_tags') }} @else {{ __('navigation.popular_tags') }} @endif
@php // Get popular tags from database $popularTags = \App\Models\Blog::active() ->whereNotNull('tags') ->pluck('tags') ->map(function($tags) { return explode(',', $tags); }) ->flatten() ->map(function($tag) { return trim($tag); }) ->filter() ->countBy() ->sortDesc() ->take(10) ->keys() ->toArray(); // Fallback tags if no tags in database if (empty($popularTags)) { $popularTags = [ 'Laravel' => __('Laravel'), 'Vue.js' => __('Vue.js'), 'React' => __('React'), 'Mobile' => __('Mobile'), 'Web Development' => __('Web Development'), 'AI' => __('AI'), 'Cloud' => __('Cloud'), 'Security' => __('Security') ]; } @endphp @foreach($popularTags as $tag) #{{ $tag }} @endforeach