Пример #1
0
 public static function findOrCreateProp($request, $propNbr, $propId)
 {
     $prop = null;
     var_dump('find or create: ' . $propId);
     if ((int) $propId > 0) {
         var_dump('prop existante');
         $prop = Propriete::find($propId);
     } elseif ((int) $propId < 0) {
         var_dump('nouvelle prop');
         $prop = new Propriete();
         $prop->prop_nom = $request->input('prop_' . $propNbr . '_name');
         $prop->save();
     }
     return $prop;
 }
Пример #2
0
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     $cats = Categorie::all();
     $proprietes = Propriete::all();
     return view('produit.create', ['cats' => $cats, 'proprietes' => $proprietes]);
 }