Posts by Rafael Laurindo • 281 points
10 posts
-
0
votes2
answers49
viewsA: Error running mysql php query
You must bring in SELECT all the columns that are being passed in the GROUP BY. Try to add in selection(SELECT), the columns being grouped(GROUP BY). Or just disable your mysql server, the directive…
-
1
votes2
answers969
viewsA: What is the usefulness of the service layer in the Laravel?
Well, I think the great advantage of this layer is actually making your code much more reusable and solid. This regarding the functionalities of your application are well divided, in classes with…
-
6
votes4
answers2211
viewsA: Javascript converting wrong date
This code is bringing the day before, because you are only passing the date, without informing the time. Thus the date is as follows:: 15/01/2019 00:00:00. And as the standard Timezone of Brazil,…
-
0
votes1
answer67
viewsA: Is it possible to randomize data from a JSON?
You can use a PHP function called shufle(https://www.php.net/manual/en/function.shuffle.php). With the shuffle function you can shuffle the elements of an array, in this case, shuffling the…
-
3
votes2
answers108
viewsA: Route envelope
Hello, Kasio! If you have similar routes, but receive parameters, the ones you receive should come last. And you can also group these routes into a group of routes, leaving them more "clean", and…
-
0
votes3
answers1426
viewsA: Pass a variable from one function to another Laravel PHP?
Hello, Beatriz! You have in this code two methods, which must be in a class. From this pre-presumed you can pass parameters to another method using the $this, which refers to the instantiated object…
-
0
votes1
answer3166
viewsA: Configure CORS on a PHP page with Basic Athenticate
You need to add in the answer, the headers that release the CORS. Adding the headers in the test.php file, it should look like this: <?php // CORS HEADERS header("Access-Control-Allow-Origin:…
-
2
votes1
answer414
viewsA: Docker creating root volume as owner
You must first create the folder that will be used as volume, in case src/: mkdir src/ And then run the command normally: docker run -it --rm -u $(id -u):$(id -g) -v $(pwd)/src:/src composer…
-
1
votes2
answers967
viewsA: I want to close a python file and then open it again
To open a file and insert a content at the end of the existing content, you must pass the flag to+(append) in the open(), instead of the flag w, which only opens the file for writing. Example: file…
-
1
votes4
answers525
viewsA: Write inside a div with a function
To insert you want to insert some content into the div, you can do it in the following ways: HTML content: $('div.count').html('Seu código HTML aqui'); document.querySelector('div.count').innerHTML…