Posts by Guilherme Freire • 767 points
34 posts
-
1
votes1
answer33
viewsA: How to add a new table 1:N (one for many) in an existing database via Migration Laravel?
A palliative solution would be to disable the constraints public function up() { Schema::disableForeignKeyConstraints(); Schema::create('tb_cidades', function (Blueprint $table) {…
-
1
votes1
answer295
viewsQ: How to change a state of a Component in React navigation
I need to change a state within a function of React navigation, this state will change a behavior in the Component function TabOneNavigator({navigation}) { React.useEffect(() => { const…
-
0
votes1
answer208
viewsQ: How to group values from a json
I have a JSON that looks like this: [ { "id": 459, "razao_social": "Testosvaldo de Testousa", "cidade": "Testolandia", }, { "id": 472, "razao_social": "teste trr", "cidade": "Belo Horizonte", }, {…
-
0
votes1
answer267
viewsQ: Lock an element inside the textarea
I need to block a part of a text that is inside ckeditor so that the user does not delete and does not change that part of the text, but it can complement the text only can not change that part…
-
3
votes2
answers99
viewsQ: Group by mysql adding null values
How can I add empty values in group by? Example: I have an appointment that is organized by ages: CASE WHEN TIMESTAMPDIFF(YEAR, STR_TO_DATE(DataNascimento, '%d/%m/%Y'),CURDATE()) < 4 THEN 'Menos…
-
1
votes2
answers940
viewsQ: Laravel eloquent returning array of array
I have this consultation using eloquent $data= \App\Logs::select('id', 'created_at') ->get() ->groupBy(function($val) { return Carbon::parse($val->created_at)->format('d-M-');…
-
1
votes2
answers976
viewsQ: Result field name instead of id on Laravel 5?
I have a relationship in Laravel but when I make an appointment comes the id and not the name of the field. Model Evento public function tipo_evento() { return…
-
1
votes2
answers881
viewsA: LARAVEL Login by email or username
Illuminate\Foundation\Auth\AuthenticatesUsers Swap the variable for the field you want to authenticate protected $username = 'username';
-
1
votes1
answer2010
viewsQ: Help with relationships in the Flat
I am really enjoying using Laravel 5.4 and I have some doubts about the relationships and how best to use it have the tables evento -id -nome categorias_evento -id -id_evento -nome lotes_evento -id…
-
1
votes1
answer639
viewsQ: compile mix Standard 5.4
Hello, I have a problem in Laravel 5.4 I am trying to put a personal js library of mine and I am not getting and remove Vue my package.json { "private": true, "scripts": { "dev": "npm run…
-
0
votes1
answer51
viewsQ: Fixed error navigation bar when using Carousel
When in mobile mode the fixed navigation bar moves in the scroll using Carousel, only in mobile mode it happens I’ve tried and I don’t know how to fix it Example…
-
0
votes2
answers345
viewsQ: Results per logged-in user id
have a users table with primary_key id and I have a people table with a user field I want to understand how to use the relationship of the Laravel for these tables and want to search the person with…
-
6
votes2
answers264
viewsQ: What is the shortcut in Netbeans to close all "+" functions?
I remember having this function in Netbeans. It’s a shortcut that closes all (+) functions or divs.
netbeansasked Guilherme Freire 767 -
1
votes2
answers394
viewsQ: Calculate percentage of total HTML columns with Jquery
I have a table that is automatically generated by PHP and manipulated by jquery, only I need to calculate the percentage of the total of each of the numerical lines, what is the best way to do this?…
-
2
votes1
answer2219
viewsQ: Loading modal during time consuming jquery function
I have a function in jquery that takes a little while and a great while and would like to do a loading modal during that time, how can I do this? $.each(dataExport, function (i, item) {…
-
1
votes2
answers1766
viewsQ: Apache PHP Server with time-consuming processes
I have an application that has some lengthy requests, I wonder if PHP how to set php to work with the best possible configuration, I wonder if while it makes this lengthy request I could make a new…
-
0
votes1
answer63
viewsQ: CSV file saved in the database
I have a large CVS file and I need to record it in my database the first line are the fields, which I have to validate if they are right and make some changes for example first line NAME, DATE…
-
2
votes2
answers3961
viewsQ: How to do a preg_replace with various conditions and changes?
How to make a PREG_REPLACE having several search and several substitutions at the same time For example I want ('/(BR|BL)/', 'B') if you have BR and BL replace with B and also ('/PH/', 'F') if PH is…
-
1
votes3
answers7106
viewsA: How to query a date range in mysql?
I managed to sort it out like this SELECT * FROM PESSOAS WHERE DATEDIFF(STR_TO_DATE(ANIVERSARIO, "%d/%m/%Y"),STR_TO_DATE('10/01/2013', "%d/%m/%Y")) BETWEEN -30 and 30
mysqlanswered Guilherme Freire 767 -
2
votes3
answers7106
viewsQ: How to query a date range in mysql?
I want to make a comparison if the date is within 30 days. For example, I have the date 10/01/2016 and I want to return all results with dates 30 days next to this for example, 09/02/2016.…
mysqlasked Guilherme Freire 767 -
2
votes1
answer42
viewsQ: How to get the penultimate item of a string?
I need to get the penultimate name from inside a string. For example; Antonio Alves Ferreira Castro need the Ferreira I know to catch the Castro I can use the SUBSTRING_INDEX(NOME, ' ', -1) tried…
mysqlasked Guilherme Freire 767 -
9
votes1
answer5066
viewsQ: how to use last-Child for the penultimate as well?
I want to make a selection with css for last and penultimate item. I know I can use the dial last-child to the last, but the penultimate? how do I?
-
4
votes2
answers59
viewsQ: How to turn the first array of a multidimensional array into a key?
how can I turn the first array of a multidimensional array into a key? for example that would be my multidimensional array array (size=5) 0 => string 'Nome' (length=4) 1 => string 'd_r_A'…
phpasked Guilherme Freire 767 -
2
votes3
answers112
viewsQ: swap Z for S char between vowels in a string
How can I exchange all occurrences of the letter Z between S within a string for example TEREZA , CEZAR, BRAZIL, HOOK would be TERESA , CESAR, BRASIL, ANZOL…
-
1
votes3
answers16505
viewsQ: How to get month and year of a date?
How I get the month and year of a date varchar in the MySQL? Example: 31/01/2013 31/02/2013 01/03/2013 01/01/2014 I only want the dates 01/2013 in the case of 31/01/2013…
mysqlasked Guilherme Freire 767 -
1
votes5
answers50
viewsA: How to change the end of a name
got it this way $nomeLimpo = preg_replace('/CON\b/','COM', $nomeLimpo); $nomeLimpo = preg_replace('/TON\b/','TOM', $nomeLimpo);
-
0
votes2
answers1305
viewsA: Using the soundex mysql function with like parameter
I managed to sort it out like this "SELECT * FROM Clients WHERE SOUNDEX( SUBSTRING_INDEX(NOME_COMPLETO, ' ', 1) = SOUNDEX('PAULA') AND SUBSTRING_INDEX(NOME_COMPLETO, ' ', -1) = 'LAST NAME'"…
-
0
votes4
answers912
viewsA: Behavior of the function preg_match() for short names
do so $nome = 'JOAO DOS TESTES'; $retira = array(' DE ', ' DOS ', ' E ', ' DO ', ' DA ', ' DAS ', ' DI '); $nomeLimpo = str_replace($retira, ' ', $nome);
-
3
votes5
answers50
viewsQ: How to change the end of a name
How to change the end of a name for example WELITON, MAICON, WELIGTON for WELITOM, MAICOM, WELIGTOM
-
2
votes2
answers536
viewsQ: How to remove a part of the string at the beginning or after the space?
I need to exchange names started with HE for E as for example HELIANE HELIAS for ELIANE ELIAS but it may be WILLIAM HENRY and switch to GUILHERME ENRIQUE…
-
6
votes2
answers1023
viewsQ: How to remove a repeated character in sequence?
How do I remove repeated characters in sequence with PHP? Entree: Ellizabetth Exit: Elizabeth
phpasked Guilherme Freire 767 -
1
votes2
answers1305
viewsQ: Using the soundex mysql function with like parameter
How can I use the soundex function of mysql as a like parameter for example I have a table people with the name Poliana Mendes Silva I want to search with soundex all the "polys" of the bank…
-
2
votes1
answer183
viewsQ: How do you call a function without waiting for it to end?
I need to call a function in PHP that records several records in the database which will take a long time, I need it to do in "background" while PHP does something else, is it possible? If yes, how…
-
3
votes1
answer1418
viewsQ: How to check if JSON has this structure?
I have a json file that varies its structure { "Plan1": [ { "Sequencia": "1", "Mês de aniversario": "agosto", "Nome Completo": "Joao da silva" } ] } And you wanted to see if these indices have those…