@extends('templates.header') @section('content')
@foreach ($category as $index => $parent)

{{ $parent->titre }}

@php $count = 0; // Initialize the count variable @endphp
@foreach ($posts as $item) @if ($item->parent === $parent->titre)
@if($item->promo === 'promo')
Promotion
@endif
@if(empty($item->prixp)) {{ $item->prix}} @else {{ $item->prixp}} {{ $item->prix}} @endif
@csrf
Devis
@php $count++; if ($count >=4) { break; } @endphp @endif @endforeach
@endforeach
@foreach ($solution as $index => $parent)

{{ $parent->titre }}

@php $count = 0; // Initialize the count variable @endphp
@foreach ($sol as $item) @if ($item->parent === $parent->titre)
@if($item->promo === 'promo')
Promotion
@endif
@if(empty($item->prixp)) {{ $item->prix}} @else {{ $item->prixp}} {{ $item->prix}} @endif
@csrf
Devis
@php $count++; if ($count >=4) { break; } @endphp @endif @endforeach
@endforeach

Derniers Produits

@php $count = 0; // Initialize the count variable @endphp @php // Get the last ID in the table $lastId = DB::table('posts')->max('id'); // Calculate the starting ID for the query $startId = $lastId - 2; // Display the last 3 posts, adjust the number as needed // Fetch posts starting from the last ID $posts = DB::table('posts') ->where('id', '>=', $startId) ->orderBy('id', 'desc') ->get(); @endphp @foreach ($posts as $post)
Nouveau
{{ substr($post->titre, 0, 43) }}
{{ $post->created_at }}
@endforeach
@endsection