Posts by Thiago • 2,866 points
149 posts
- 
		1 votes2 answers81 viewsQ: Add data from "pivot" table of relation Many to ManyI have 3 tables (clientes,seguradoras e clientes_seguradoras) that relate through 2 Models (Cliente e Seguradora) in Laravel Each customer can have several insurers, and for each insurer he can add… 
- 
		1 votes1 answer201 viewsQ: execute Docker/Docker-Compose commands on external folderI created a simple LAMP server using Docker/Docker-Compose, I was able to initialize the containers pointing to an external folder to which the Docker files are, the problem is that I need to run… 
- 
		4 votes1 answer94 views
- 
		2 votes1 answer57 viewsQ: Does Settimeout run in parallel on Node.js?I’m studying the concepts of asymchronism, I know that Node.js is single-threaded and that for some types of task he delegates the same to the libuv (which has 4 threads by default) and others for… 
- 
		1 votes0 answers55 viewsQ: Subtract sum of two columnsI have a table with this structure: ...| tipo | quantidade E 20 S 15 E 500 the column tipo can be "And", incoming, and "S" exit. and the quantidade is a number. How can I make a select add all type… 
- 
		1 votes1 answer137 viewsQ: Doubt about closures, function inside loopI’m studying about closures in Javascript based on the book "You Don’t Know Js" by Kyle Simpson. I understood the concept of closure, that he can "hold" the reference to the lexical scope outside… 
- 
		1 votes2 answers199 viewsQ: Relation Hasmanythrough returns empty EloquentI am developing a sale screen and on this screen it is possible to select several products that belong to the table produtos, the structure of the tables is as follows:: vendas: - id produtos: - id… 
- 
		1 votes2 answers638 viewsQ: jQuery Mask does not work on elements created dynamicallyI’m using the jQuery Mask to format currency in a form, and in this form it is possible to add several values dynamically and for this I duplicate the div that contains the input, only when… 
- 
		4 votes2 answers643 viewsQ: Create and edit data from a table with Laravel relationshipI have a table called agenda, among the fields of this agenda it is possible to add several responsible for it, which are the users registered in the system, for this there is a field of type… 
- 
		0 votes1 answer97 viewsQ: Capture Resource route id Checkbox with extra parameterI have the following route of type Resource: Route::group(['prefix' => 'processos' ,'namespace' => 'Processos', 'middleware' => 'processo_exists'], function () { // Andamentos… 
- 
		2 votes1 answer389 viewsQ: Relationship of Laravel RelationshipI have a model called Processo, this model has a relationship hasMany with the model Andamento, the model Andamento has a queryScope what use to return the data already with other relations of this… 
- 
		0 votes1 answer309 viewsQ: Relate two tables through anotherI have 3 tables, processos, empresas and processos_empresas. table structure: processos: - id empresas: - id - nome_empresa processos_empresas: - processo_id - empresa_id Brief explanation of how… 
- 
		0 votes3 answers653 viewsQ: List 3 tables in LaravelI have 3 tables: contratos, contratos_empresas and empresas In the system there is a form for registration of contracts, in this form there is a select Multiple (that allows to select several… 
- 
		1 votes1 answer58 viewsQ: How to avoid many "use" namespace resolution callsI’m refactoring a small system in mvc that used the standard classmap to the psr-4, and was "obliged" to use multiple "use" within each controller to resolve the namespaces. Example of what the… 
- 
		1 votes1 answer32 viewsQ: What is Boostrap.php and why is it used instead of index.php?I see that many frameworks/Ibraries have a file Index.php which only includes the Boostrap.php, and in that Bootstrap.php is included the autoload of Poser and other application files, because there… 
- 
		2 votes0 answers54 viewsQ: htaccess does not work in "online" subdirectoryI made a small script that runs locally inside a folder (localhost/sistema) so far all right, the problem started to happen after I tried to upload that same script to an online server (Hostgator),… 
- 
		1 votes2 answers53 viewsQ: Capture data by default until last spaceI am trying to make a Scrapping of a website, and would like to capture the value that follows the pattern below: Advogado: XXXXX Número do Processo: XXXXXX OutroCampo: XXXXX usually what separates… 
- 
		2 votes1 answer361 viewsQ: Error trying to import . Bak file from Sql Server on LinuxI am very beginner in SQL Server and am trying to import a file . Bak from a backup that came from another server (Windows) on Linux (Linux Mint 19) The command I used in the terminal was that:… 
- 
		7 votes1 answer99 viewsQ: Double rule in LIMITI have a news table with the fields titulo, conteudo and destaque, being the highlight int(1), is a boolean value just to check whether a news is featured or not, what I would like to do is select a… 
- 
		2 votes1 answer63 viewsQ: Use two titles (Abels) in a bootstrap input groupHow can I use two tabs (label) on top of a group button using bootstrap? image: The idea is to use numerical "range" from 0 to 10, with a title on the left and a title on the right side.… 
- 
		0 votes1 answer179 viewsQ: Create dynamic table headerI’m trying to create a dynamic header based on an array that the function receives, the structure I tried, and it didn’t work, is the following: function createDynamicHeader(columns) { var table =… 
- 
		-1 votes1 answer57 viewsQ: How to return multiple fields as a single array or string?I have a table in the database with several phones, the name of the fields is numbered as follows: telefone1, telefone2, telefone3 your return is like this: Array ( [telefone1] => 190 [telefone2]… 
- 
		1 votes1 answer373 viewsQ: Create dynamic associative array within loopI’m having a hard time trying to create a dynamic associative array within a loop, the error returned in the console is Cannot read property 'push' of undefined, the idea is a sports quiz with 3… 
- 
		0 votes1 answer934 viewsQ: Save cookies from one request and use another next CurlI am trying to log into a website and save cookies to have access to other pages, I found the option 'CURLOPT_COOKIEJAR' that saves cookies in a NETSCAPE file, the doubt is how would be made a… 
- 
		0 votes0 answers16 viewsQ: Most appropriate way to switch classes of active Apis in a system?Next, In this application there is an SMS sending module that has several different Apis, all follow the same basic standard, implement the required methods of the SMS interface, something like… 
- 
		0 votes1 answer90 viewsQ: group records with the same value as a columnI have a table called shops, this table has: ..., store name and loja_category, example: nome_loja | loja_categoria -------------------------- loja1 | roupas loja2 | brinquedos loja3 | roupas what I… 
- 
		0 votes1 answer41 viewsQ: List column of one table with all records of anotherI have 2 tables, posts and posts_images, the table post owns the fields id, title, Category, and images, and the table posts_images possesses: post_id, img_url etc. I would like to relate the field… 
- 
		1 votes0 answers56 viewsQ: Send synchronous request with ajaxI am using Ajax to send data via POST, the "problem" is that I do not want it to be sent asynchronously in the background, I would like to send with the same behavior of a form Ubmit, I added the… 
- 
		0 votes1 answer236 viewsQ: Create and store MD5 hash of existing value after INSERTI have an X table, with a field called email and another email_hash, I would like that every time a new record was inserted with email, Mysql would use the value of the inserted email and create an… 
- 
		0 votes1 answer75 viewsQ: First element array of a multidimensional array as key for othersI am reading an Excel spreadsheet that returns a result like the below, the first array being the name of the columns Array ( [0] => Array ( [0] => nome [1] => sobre_nome ) [1] => Array… 
- 
		0 votes1 answer48 viewsQ: Sigep API returns array with visibility of propertiesI’m using a API by Sigep that I found on github, did some tests and worked, the problem is that I would like to return the results in JSON or XML, and the return of the class is coming with the… 
- 
		1 votes1 answer57 viewsQ: Update table so that a field has a unique valueHow can I update a record in Mysql so that when I change a field of this record all other records change so that this field has a unique value? for example, I have a table called players and a field… 
- 
		2 votes2 answers442 viewsQ: iterate array with element id to display/hideI have several arrays that hide or display event-based fields change of a select, the problem is that when iterating the array with the element id only the last value of the array is displayed, as… 
- 
		0 votes1 answer127 viewsQ: Hide element only if visible or vice versaI’m wearing the event change in a select field, where the corresponding option is the id of a div, what I would like to do is to display the selected div and hide the rest only if it is visible or… 
- 
		1 votes0 answers36 viewsQ: Good practices for a Model that interacts with 2 tables?I am building an MVC application, to be more exact for sending SMS messages, and I came across the following situation: I have the smsModel which is primarily responsible for sending, scheduling,… 
- 
		12 votes2 answers1397 viewsQ: Dynamic subdomain systemI recently saw an app/site called Sarahah, and an interesting feature was that when registering, the username became a subdomain, something like "usuario1.site.com.br", is there any way to do this… 
- 
		1 votes1 answer1137 viewsQ: Create text file and download without storing it on the serverHow can I create a file at script run time to download it, but without having to save to the server directory? Something like: $dataOutput = "5s6a56sa565sa65a6s56sa565sa656sa565sa656as56sa556as5as";… 
- 
		0 votes1 answer82 viewsQ: Compare different value, value "null" does not enter the resutaldoI have a table of files, and in it there is a field called "document type", which is filled with 1 or when it is not filled is NULL, the problem is that when I give a SELECT and use the comparator… 
- 
		2 votes2 answers55 viewsQ: Is it possible to intercept calls to class functions?In a multi-level user application, not everyone can access/use the same methods, there is some way to intercept the call of a method/function so that a validation can be made according to the user… 
- 
		0 votes0 answers28 viewsQ: Mysql full text does not find underlined resultsI’m using the MATCH/AGAINST of mysql to implement a search system, the problem is that, words with underlining (ex: lista_compras_mercado.txt) are interpreted as one, there is some way to turn… 
- 
		0 votes0 answers115 viewsQ: CSRF token is only valid after first ajax requestI am building a login system via ajax and using a token, saving in a SESSION, passed by javascript, the idea is that each page "Reload" is created a new token to avoid Force and etc, but as I am… 
- 
		0 votes0 answers564 viewsQ: Forbidden for any htaccessI’m using the Uniform Server portable server, I’ve already decoded the line to activate apache mod_rewrite, but I’m getting the error 403 Forbidden for any file . htaccess to use, this first is from… 
- 
		0 votes0 answers360 viewsQ: Use function within ajax Response SuccessI have a list of tasks with checkboxes, which when marked updates, via ajax, the status of the task in the database, what I want to do is return the completion percentage of the list, which is… 
- 
		0 votes2 answers94 viewsQ: How to organize multi-level MVC applicationI am developing an application following the MVC standard, and will have 2 levels of users, the normal and the admin, as regards the options of what each user can do, it is better to make a logic in… 
- 
		1 votes1 answer95 viewsQ: Parameters functions for click event do not workI’m trying to highlight a text with the event click and then "slip" on the second click, I took the hint of a code that I had already seen on codepen , I am passing two functions to the event click,… 
- 
		2 votes1 answer477 viewsQ: Codeigniter validation form does not allow accents and other "br" charactersI’m using the rule "alpha_numeric_spaces" to validate letters and numbers with space, but when I use some special character or letters like "ç", the validation does not pass, there is some way… 
- 
		3 votes1 answer11657 viewsQ: Duplicate database record with new idI have a table in the database called user, with n fields, how can I duplicate a particular record only with a new id? insert into usuarios * select * from usuarios where id = x? Obs: this id is a… 
- 
		1 votes1 answer589 viewsQ: Group arrays with same index valueI have the following array: Array ( [0] => Array ( [id] => 6 [projeto_id] => 5 [etapa_num] => 1 [tarefa] => teste 1 [status] => 0 ) [1] => Array ( [id] => 7 [projeto_id]… 
- 
		0 votes1 answer30 viewsQ: Using active menu as input "radio"I’m using a horizontal menu of boostrap, its structure is basically like this: <ul class="nav nav-pills"> ... <li data-type="news" id="5" role="presentation"><a… 
- 
		1 votes2 answers2757 viewsQ: Search a key array and return valueI am manipulating a large XML file that when read returns several array, one inside the other, is it possible to search the key of an array and return its value? or an array if there is more than…