PromotionController.php 1011 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace App\Http\Controllers\frontend;
  3. use App\Http\Controllers\Controller;
  4. use App\Models\Produit;
  5. use App\Models\Categorie;
  6. use App\Models\Promotion;
  7. use App\Models\Contact;
  8. use Illuminate\Http\Request;
  9. class PromotionController extends Controller
  10. {
  11. public function Index($categorieId = null){
  12. $promotions = Promotion::where('etat','1') ->paginate(6);
  13. $produits = Categorie::where('etat','1')->get();
  14. $categories = Categorie::where('etat','1')->get();
  15. $contacts = Contact::where('etat','1')->get();
  16. return view('frontend.promotion.promo',compact('promotions','categories','contacts','produits'));
  17. }
  18. public function show ($id){
  19. $promotion = Promotion::find($id);
  20. $categories = Categorie::where('etat','1')->get();
  21. $contacts = Contact::where('etat','1')->get();
  22. return view('frontend.promotion.details',compact('contacts','promotion','categories'));
  23. }
  24. }