/** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { $agentes = Agente::Lista()->get(); $agente = array('' => 'Seleccionar...'); foreach ($agentes as $var) { //creo lista de agentes $agente = $agente + array($var->id => $var->legajo . ' - ' . $var->apellido . ' ' . $var->nombre); } $deposito = Deposito::lists('nombre', 'id')->all(); $deposito = array('' => 'Seleccionar...') + $deposito; $producto = Producto::lists('nombre', 'id')->all(); $producto = array('' => 'Seleccionar...') + $producto; return view('salida_material.create', compact('agente', 'dependencia', 'deposito', 'producto')); }