public function index() { $tiposEmpresas = TipoEmpresa::orderBy('tipo', 'asc')->paginate(10); return view('TipoEmpresa.Index')->with('tiposEmpresas', $tiposEmpresas); }
public function editar() { $usuario = Auth::User(); $empresa = Empresa::where('idUsuario', '=', $usuario->id)->first(); $tiposEmpresas = ['-1' => 'Selecione o tipo do empreendimento'] + TipoEmpresa::orderBy('tipo', 'asc')->lists('tipo', 'id')->all(); $categorias = ['-1' => 'Selecione a categoria'] + Categoria::orderBy('nome', 'asc')->lists('nome', 'id')->all(); $cartoes = Cartao::orderBy('tipo', 'asc')->get(); $vendedores = ['-1' => 'Selecione o usuário'] + Vendedor::with('Usuario')->get()->lists('Usuario.name', 'id')->all(); $tiposCartoes = ['-1' => 'Selecione o tipo dos cartões'] + TipoCartao::orderBy('descricao', 'asc')->lists('descricao', 'id')->all(); return view('Empresa.Edit')->with('empresa', $empresa)->with('tiposEmpresas', $tiposEmpresas)->with('cartoes', $cartoes)->with('categorias', $categorias)->with('vendedores', $vendedores)->with('tiposCartoes', $tiposCartoes); }