/**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker::create();
     $imovelIds = Imovel::lists('id')->toArray();
     $caracteristicaIds = Caracteristica::lists('id')->toArray();
     foreach (range(1, 100) as $index) {
         DB::table('imovels_caracteristicas')->insert(['imovel_id' => $faker->randomElement($imovelIds), 'caracteristica_id' => $faker->randomElement($caracteristicaIds), 'numero' => $faker->randomElement($array = array('2', '3', '1', '0'))]);
     }
 }
예제 #2
0
 public function pagModificar($id)
 {
     $PaquetesItem = Paquete::findOrFail($id);
     $PaquetesCaracteristicas = $PaquetesItem->Caracteristicas;
     $Caracteristicas = Caracteristica::select('id', 'nombre')->orderBy('nombre', 'asc')->get();
     $aux = end($PaquetesCaracteristicas);
     $ultimaCaracteristica = end($aux);
     return view('Paquetes/PaquetesModificar')->with(['PaquetesItem' => $PaquetesItem, 'PaquetesCaracteristicas' => $PaquetesCaracteristicas, 'Caracteristicas' => $Caracteristicas, 'ultimaCaracteristica' => $ultimaCaracteristica]);
 }
 public function exportarCaracteristicas($id)
 {
     $caracteristicaItem = Caracteristica::findOrFail($id);
     $view = \View::make('Caracteristicas.PDFCaracteristicas', compact('caracteristicaItem'))->render();
     $pdf = \App::make('dompdf.wrapper');
     $pdf->loadHTML($view);
     return $pdf->stream('invoice.pdf');
 }