Posts by Ricardo Pereira Dias • 373 points
10 posts
-
2
votes2
answers250
viewsA: How to join the query string in Laravel 4 pagination?
The model Products does not know the parameters passed in the filter. In order to identify them, it is necessary to instruct you to pass the parameters in the construction of pagination links. This…
-
4
votes3
answers818
viewsA: SOLID is all that they say?
On the Principles in Programming SOLID contains 5 principles of software design, but not all existing principles. There are several: SOC Separation of Concerns; DRY Don’t Repeat Yourself; YAGNI You…
-
2
votes1
answer66
viewsA: Can any project be suited to the principles preached by SOLID? What are the steps to this?
There is no sequence to "tailor" a project to SOLID! The acronym refers to development principles that should, whenever possible, be followed to avoid problems in software over time, especially if…
-
0
votes1
answer607
viewsA: When called the update method, the Laravel does not recognize the route
Operation of the Laravel Cruds The exception "Methodnotallowedhttpexception" is triggered when an invocation is made for a path whose method (POST, GET, PUT/PATH, DELETE) has not been specified…
-
1
votes1
answer32
viewsA: Sort name of php file
Use "rsort" to sort down the list of files returned by "glob". For example: $lista = glob("*.pdf"); rsort($lista); foreach ($lista as $arquivo) { echo "<a…
-
4
votes2
answers1995
viewsA: Remove mask with javascript
You can use regular expression with "replace": var value = "R$ 12.000,00"; var clean = value.replace(/[^0-9,]*/g, '').replace(',', '.'); alert(clean); In the above code, the result will be a string…
javascriptanswered Ricardo Pereira Dias 373 -
5
votes2
answers148
viewsA: as leaves the dropdown background white
The problem is that the header tag is with opacity set to "0.6". As you are tinkering with the opacity of the "parent" (header) element, the "opacity" property affects all elements inside the…
-
0
votes1
answer149
viewsA: Is it possible to convert pdf to png without using Imagick?
Some hosts may have Imagemagick installed, even without the PHP extension. In these cases, you can invoke the program directly from the system through PHP’s "exec()": <?php $location =…
phpanswered Ricardo Pereira Dias 373 -
0
votes1
answer68
viewsA: "The command 'migrate:Fresh' does not exist." in a unit test (phpunit) in Laravel
Try using Laravel’s "Refreshdatabase" trait. <?php namespace Tests\Unit; use App\Domains\UserDomain; use App\Models\User; use Tests\TestCase; use Illuminate\Foundation\Testing\RefreshDatabase;…
-
3
votes1
answer123
viewsA: Foreach PHP problems to read Json
The problem happens for two reasons: Why you are not iterating the "items" but only the "date" index". Because the index "code" does not exist in all items. To solve the first problem, a second…