Posts by Matheus Picioli • 482 points
26 posts
-
3
votes1
answer722
viewsQ: Setstate Flutter
Good afternoon. I’m starting with flutter (I came from Reactnative), watching some courses... and I got the question: What does setState really control? In Reactnative he looks at everything we set…
-
1
votes1
answer208
viewsA: Accessing attributes from multiple different relationships in a CRUD Eloquent Laravel 5.7
As long as your relationships are correct, you can call the statistical method create of each model, in an order that you have all the necessary data. Example: $solicitacao = Solicitacao::create([…
-
2
votes1
answer758
viewsA: Ignore files when uploading to repository
You committed these files before creating . gitignore, there is no relation to the framework version. When this case occurs you have to run a git command to remove everything that has already been…
-
0
votes1
answer29
viewsA: Check between time in a period
You can use spy classes to work with date and time, such as date time, because she has support for this matter of days difference. You can still, too, work with a more complete class that extends…
phpanswered Matheus Picioli 482 -
1
votes2
answers360
viewsA: Convert the date format of an array to Laravel/PHP
Yes, if you are bringing this data by a model (which is recommended), you can turn your database field into a Carbon object, added the column name within the array $dates of your model. Example:…
-
1
votes2
answers436
viewsA: SQL parameter in PDO PHP does not work
The parameters you do not pass in the method execute(). You play the method bindValue(). Follow an example: <?php $stmt = $db->prepare("SELECT * FROM table WHERE id=? AND name=?");…
-
0
votes2
answers985
viewsA: Login customizado Laravel
You have some methods that you can override, in your model that replaces the default User, you have to put a data mutator, similar to this: getPasswordAttribute() { return…
-
1
votes1
answer132
viewsA: I cannot correctly pass the arguments to the function that updates data in the database (Laravel)
When you submit the form, the data comes with the Request class. Ideally you would add as a second parameter a request, already with dependency injection: public function atualizar($id, Request…
-
0
votes3
answers1083
viewsA: Onclick, With two "Actions" on the same button. PHP
You can add a variable to serve as a flag, which receives true/false, or clicked, null, anyway. As he clicks the button, you do the necessary checks, and change the flag. But as our friend…
-
1
votes1
answer78
viewsA: User with browser cookies disabled
I think with PHP it won’t be possible, but you can try javascript, something like: <script type="text/javascript"> var tmpcookie = new Date(); chkcookie = (tmpcookie.getTime() + '');…
-
2
votes2
answers293
viewsA: Uniquely identify the smartphone
You can assign an identifier GUID, since the chances of it repeating itself are extremely low. According to this answer in the OS there is a 1% chance of collision if it generates 2.600.000.000.000…
androidanswered Matheus Picioli 482 -
1
votes1
answer78
viewsA: How to avoid dual Insert with different mysql Primary key
If you’re doing this validation and it’s not working, which in my view was supposed to work. I could try to make a unset($_POST["btnCadastrar"]) to ensure that this guy will no longer come filled by…
-
1
votes1
answer15
viewsA: Recording errors from Soap-Server
You can do it this way: $conteudo = $fault->faultstring; Storage::put('logxml.txt', $conteudo); Reference This name is just for example, you can either change the name, or add folders before, or…
-
0
votes1
answer54
viewsA: manipulating an array to mount the grid
If it’s the sum index, you could do so: if (isset($result[$id])) { $result[$id][] = $data; $result[$id]['sum_total] += $data['sum'] } else { $result[$id] = array($data); $result[$id]['sum_total] +=…
phpanswered Matheus Picioli 482 -
0
votes1
answer42
viewsA: Create a link to a single password-free user in the database
I will make an example based on what I understood, and using the standard models and relationships through models. Controller in question: public function acao1 ($id_orcamento){ return…
-
0
votes1
answer42
viewsA: Return Ids searching for the value of a multidimensional array
I don’t see why not use foreach, because when it comes to arrays with index it is a hand on the wheel. Foreach is native of PHP. But let’s get down to business: <?php $lista = array( array( 'id'…
-
1
votes1
answer562
viewsA: Filter system by category
You could add the filters to the url, that is, you can play your select inside the form. On the page that will receive the request could do something like: I’ll do it with PDO $db = new…
-
1
votes1
answer696
viewsQ: Redirect after login Standard 5.5
Good morning, I’m using Laravel’s standard authentication scafold, and repurposing the structure by overriding the methods I need for you to behave the way I want you to. I customized the default…
-
1
votes0
answers213
viewsQ: Inserting data in the 1:N - Laravel 5 ratio side 1
I have the following tables, Condominios and CondominiosTaxas, that are a relationship 1:N , respectively, my relationship in the model Condominio: public function Taxas() { return…
-
2
votes0
answers292
viewsQ: I can’t access the IP of the hotel
Good morning, I’m trying to install the Homestead from Laravel 5.5, following the documentation. However, when I try to access IP 192.168.10.10, which is the default IP of the Homestead, it keeps…
-
0
votes1
answer276
viewsQ: Relation Many to Many with id type UUID Laravel 5.4 Eloquent ORM
I’m following Laravel’s documentation to make that relationship with the id type uuid. In the relationship methods I specified the pivot table and the IDS fields, however I went to debug in Tinker…
-
0
votes0
answers542
viewsQ: Authentication with JWT Auth and dingo Laravel API 5.4
I authenticated with the standard user model of Laravel 5.4, but now, I did the same implementation, only with a custom model, and it’s not working. Give me back that mistake "message": "Undefined…
-
0
votes1
answer752
viewsQ: Laravel 5.4 and Dompdf - problems?
I’m trying to generate a PDF from a view, and it’s working, however, when I call the route to call the controller, the upload is for several seconds, even minutes to generate the PDF, and download,…
-
-4
votes2
answers1598
viewsA: Test access method, whether it is GET or POST
It would be right to do this equal treatment in the above answer, or (if your business logic allows), you can simply put $_REQUEST['nome_parametro'], that it will pick up POST, GET, PUT, DELETE,…
phpanswered Matheus Picioli 482 -
0
votes0
answers229
viewsQ: How to send a dynamic image to PHP with jQuery ajax function
I have a blank div, which dynamically receives an image, almost as soon as the page loads, this image is the Crop of the original image, I’m able to catch it through the code: $('.class > img')…
-
7
votes1
answer4876
viewsQ: Customizing a user model Laravel 5.4 - Login problem
I tried everything already, but I can’t solve a problem in the login system Laravel which is this: I created a model called Usuarios, I put all the information in it that has to be properly placed,…