salut je n'arrive pas à envoyer une variable à la vue. Voici ma founction
public function postLignecommande(){
$rules['article_code'] = 'required';
$rules['commande_code'] = 'required';
$rules['quantite'] = 'required|numeric';
$validation = Validator::make(Input::all(), $rules);
if($validation->fails()){
return Redirect::to('showvente/show')
->withInput()
->withErrors($validation)
->with('erreurs',$validation->messages());
}else{
$ligneCommande = new LigneCommande();
$ligneCommande->article_code = Input::get('article_code');
$ligneCommande->commande_code = Input::get('commande_code');
$ligneCommande->quantite = Input::get('quantite');
if( $ligneCommande->save()){
$listeProduit = DB::table('ligne_commandes')
->join('articles','articles.code','=','ligne_commandes.article_code')
->join('commandes','commandes.code','=','ligne_commandes.commande_code')
->where('commandes.client_code','=',Input::get('commande_code'))->get();
return View::make('bmstemplate.vente')
->with('succes','Insertion effecuer avec succès')
->with('listeProduit',$listeProduit);
}
}
}
 
  Tu peux mettre ton code en forme s'il te plait ?
Sinon oui tu y arrive pas, mais tu as debug ? Tu as fait des die et des var_dump un peu partout au niveau controller puis vue ?
 
  Fais un dd() sur ta variable juste avant de l'envoyer à la vue pour voir si elle n'est pas vide quand tu l'envoie
 
  Bonjour,
As-tu des messages d'erreur ? Si oui est-ce que tu peux nous les donner.
Je reposte ton code tel quel avec la mise en forme, juste pour mieux voir :
public function postLignecommande(){
  $rules['article_code'] = 'required';
  $rules['commande_code'] = 'required';
  $rules['quantite'] = 'required|numeric';
  $validation = Validator::make(Input::all(), $rules);
  if($validation->fails()){
    return Redirect::to('showvente/show')
    ->withInput()
    ->withErrors($validation)
    ->with('erreurs',$validation->messages());
  }else{
    $ligneCommande = new LigneCommande();
    $ligneCommande->article_code = Input::get('article_code');
    $ligneCommande->commande_code = Input::get('commande_code');
    $ligneCommande->quantite = Input::get('quantite');
    if( $ligneCommande->save()){
      $listeProduit = DB::table('ligne_commandes')
      ->join('articles','articles.code','=','ligne_commandes.article_code')
      ->join('commandes','commandes.code','=','ligne_commandes.commande_code')
      ->where('commandes.client_code','=',Input::get('commande_code'))->get();
      return View::make('bmstemplate.vente')
      ->with('succes','Insertion effecuer avec succès')
      ->with('listeProduit',$listeProduit);
    }
  }
} 
  Salut,
je dirais plutôt, 
return View::make('bmstemplate.vente',compact($listeProduit))
      ->with('succes','Insertion effecuer avec succès');
Il me semble que le with gère un flash session.
 
  return view('ton file', compact('listeProduit'))->with('success', 'Insertion effectuée avec succès'); 
  Hello,
il me semble que la fonction compact prend en parametre un string ou un tableau de string.
compact("listeProduit")Je ne pense pas que cela fonctionnera avec
compact($listeProduit) 
  Oui Martin :
$uneVar = 'truc';
$uneVar2 = 'much'
return view('view.view', compact('uneVar', 'uneVar2'));