public function create() { $usuarios = Usuario::lists('nome', 'id'); $tiposEmpresas = TipoEmpresa::lists('tipo', 'id'); $planos = Plano::lists('nome', 'id'); $vendedores = Vendedor::all(); $vendedoresSelect = array(); //TODO: Refatorar isso depois foreach ($vendedores as $vendedor) { $vendedoresSelect[$vendedor->id] = Usuario::find($vendedor->idUsuario)->nome; } return view('Empresa.Create')->with('usuarios', $usuarios)->with('tiposEmpresas', $tiposEmpresas)->with('planos', $planos)->with('vendedores', $vendedoresSelect); }
public function index() { $vendedores = Vendedor::all(); }