Posts by Wallace Maxters • 102,340 points
1,984 posts
-
13
votes1
answer1308
viewsQ: What are the design standards for Serviceprovider and Servicecontainer used in Laravel and Symfony?
In frameworks Laravel 4 ou 5 and Symfony, I realize that there are two classes that are essential for the operation of the whole system: Servicecontainer and Serviceprovider. It seems to be a way…
-
4
votes1
answer1000
viewsQ: How does Laravel 5 make an instance to be passed automatically if we just set Type Hinting in the parameter in a function?
I believe that this is a fully valid curiosity, since it greatly facilitates and speeds up development. I always analyze the code of the frameworks I use, such as Cakephp 2, Laravel 4 and Symfony 2.…
-
1
votes1
answer106
viewsA: How do I use the same app/config/local/database.php configuration when I’m running in enviroment "testing"?
At first, there is a gambit that can be done. You can create a file called app/config/testing/database.php and, when "copy and paste" the app/config/local/database.php, you can simply use the…
-
0
votes0
answers35
viewsQ: What is the use of each number (which are separated by endpoint) in the versions?
Usually, in libraries (I’m talking about any programming language), we have the current version of the library. I’m not talking about something like Symfony 2 or jQuery 2 (which are names usually…
-
2
votes1
answer353
viewsA: Is there any way to run Laravel on the command line in interactive mode?
Yes, there is a way that works both for the Laravel 4 as to the Laravel 5. Just run php artisan tinker at the command line Example: Note: The difference between commands on Laravel 4 and Laravel 5…
-
2
votes1
answer353
viewsQ: Is there any way to run Laravel on the command line in interactive mode?
In PHP, I know it is possible to rotate it interactively on the command line, which is via the command php -a. Even better would be using the library psysh. But when it comes to not just running…
-
2
votes1
answer106
viewsQ: How do I use the same app/config/local/database.php configuration when I’m running in enviroment "testing"?
In the Laravel 4, we have three types of environments that can be defined: local, production and testing. I even published something related to the configuration of the environment local here in :…
-
3
votes2
answers362
viewsA: Date_format does not work in code
There is an error in your code. You are trying to format the date by php, observing your code, but by your intention I realize you want to format by Mysql. Then change this snippet of your query to:…
-
1
votes2
answers1943
viewsA: PHP - Check for GET parameters in a URL
Simple. You can tell what’s in the $_GET empty($_GET) Or (count($_GET) > 0) If it is a specific url, do so strlen(parse_url($url, PHP_URL_QUERY)) > 0…
phpanswered Wallace Maxters 102,340 -
2
votes3
answers1454
viewsA: Access all file settings. env
Well, actually, you could solve the problem using the internal resource used by Laravel 5. It is a library (which is already installed in the Laravel 5) called Dotenv. See how to use: $dot = new…
laravel-5answered Wallace Maxters 102,340 -
1
votes2
answers601
viewsA: Is there an Laravel Blade Statement Tag (instead of just printing)?
As already stated in some of the comments, Blade does not prevent the user from using php tags. However, there are those who still prefer a solution in the Blade - like me. Way 1 - The gambiarra So…
-
1
votes2
answers601
viewsQ: Is there an Laravel Blade Statement Tag (instead of just printing)?
I was wondering if there’s any way to create expressions with Blade’s tags Laravel. I mean, the same way we use {{ $valor }} to be able to print something, it would be possible to use the Blade…
-
1
votes2
answers421
viewsQ: What is TDD and what is it for?
I was taking a look at PHPUnit - which is a unit testing framework . Taking a look at some tutorials, I came across a term called TDD. What comes to be TDD? And what’s his use in day-to-day…
-
1
votes1
answer1832
viewsQ: How to customize the Laravel 4 error page?
When an error occurs in Laravel 4, with the configuration of app.debug equal to false, the following page is returned: In that case, so much for mistakes 500 how much to 404, this page is displayed.…
-
1
votes1
answer617
viewsQ: How to disable query caching in MYSQL?
When we use the command SHOW VARIABLES LIKE 'have_query_cache' we can see if the cache is enabled or not. Upshot: Variable_name | Value ---------------------------- have_query_cache | YES How do I…
mysqlasked Wallace Maxters 102,340 -
6
votes1
answer2200
viewsQ: What is the maximum amount an array can support in PHP?
In PHP I often work a lot with frameworks. Generally, they bring the results of the query to a database in a array. In some cases, when the number of data from a table or a relationship reaches a…
-
3
votes1
answer2299
viewsQ: How to clear Mysql’s cache of queries?
How do I clear the cache of darlings, stored by Mysql? What is the command?
-
2
votes1
answer4332
viewsA: Open project with Localhost - Ubuntu
In Ubuntu, apache, with its default settings, does not run the folders inside var/www, and yes the ones inside var/www/html. Place the files or folders inside var/www/html, and the problem will be…
-
1
votes1
answer114
viewsQ: Sublime Text - How to ignore the acquisitions sought by the shortcut (Goto Anything) CTRL+P?
In sublime text we have an option called Goto > Goto Anything, which is accessed via the shortcut CTRL + P. This is very useful as we can open a project file by simply pressing CTRL+P and typing…
-
3
votes2
answers124
viewsQ: Is there any way to toggle with attributes in jQuery?
In the JQuery, we have a function called toggle which allows us to switch between the element being visible or not. And the function toggleClass, which toggles between whether or not to include a…
jqueryasked Wallace Maxters 102,340 -
2
votes1
answer595
viewsA: How to get a PHP object in an ajax function
In the Laravel 5, when we want to return something (Be HTML or HTML JSON), we should use the function response or view. It is necessary to use the keyword return also. So instead of doing: echo…
-
20
votes2
answers920
viewsQ: What is the purpose of this language called Brainfuck?
There is a programming language called Brainfuck which has a very confusing and difficult to understand syntax. For example, to make a simple Hello World in the same, you have to do the following:…
brainfuckasked Wallace Maxters 102,340 -
2
votes2
answers257
viewsQ: Extra margin appearing on elements with display input-block. How to resolve?
I have a problem with my css. I was working on a style to format some buttons. Everything went well. However, my buttons are with an extra margin showing up. That is, I have not set margin on my…
cssasked Wallace Maxters 102,340 -
4
votes1
answer122
viewsQ: Why is it not recommended to use the asterisk in css "reset" operations?
I’ve seen several internet tutorials on css reset teaching that one should never use the asterisk to apply the modifications. For example: * { margin:0; padding:0; } But, along with the statement…
cssasked Wallace Maxters 102,340 -
14
votes1
answer16393
viewsQ: What does Assets mean?
Long time working with MVC frameworks in PHP, such as Symfony, Laravel and Codeigniter. Usually, when it comes to the Views structure, there are always features to facilitate the inclusion of files…
terminologyasked Wallace Maxters 102,340 -
7
votes2
answers998
viewsQ: Is there any way to change a commit message?
I work with git in all projects of the company where I work. Unfortunately, some programmers end up posting some kind of message, in a hurry, in a commit. This makes things difficult, because…
gitasked Wallace Maxters 102,340 -
1
votes3
answers1345
viewsA: It is possible to configure upload_max_filesize via . htaccess
According to this website has as yes. Just add that to your .htacess: #configuração php php_value upload_max_filesize 10M Also another good reference is here in this question of SOEN…
phpanswered Wallace Maxters 102,340 -
4
votes2
answers661
viewsA: (Laravel) method $.get can’t find route
Using the ../ can cause problems if you are on a route with a sub-segment. For example, localhost:8000/admin/.. /test/1 Is the same as localhost:8000/teste/1 In that case:…
-
2
votes1
answer1555
viewsA: What is the difference between Model::lists() and Model::all()->lists() in Laravel?
Well, the difference is this: When you invoke lists you cause only the specific fields to be specified in the Orm and bring them in array. Example: Usuario::lists('nome', 'id'); Is the same as :…
-
1
votes1
answer56
viewsQ: How do I set up Laravel 4 to automatically detect which environment I’m in (production and development)?
In the Laravel 4, we have a configuration file on app/config/database.php. And in the folder app/config/local/database.php you have another file. The Laravel 4 has a mechanism to be able to detect…
-
6
votes1
answer476
viewsA: How to use Angular JS and Laravel 4 without conflicting with Blade?
For you not to conflict, you will have to change the internal processing tags of BladeCompiler of Laravel. Or depending on the case, you can change the AngularJS. HIGH BLADE It is possible to do…
-
1
votes2
answers2281
viewsQ: How to list routes in Laravel (No Artisan)?
In the Laravel 4 i know how to list all routes through the command line. Just do php artisan routes. However, now, I have need to do this in the source code of my application. That is, I need to…
-
3
votes1
answer1555
viewsQ: What is the difference between Model::lists() and Model::all()->lists() in Laravel?
In the Laravel, we have a method that we can list fields from a table in the key value style. I can do it two ways Thus: Usuario::lists('nome', 'id'); And So: Usuario::all()->lists('nome', 'id');…
-
5
votes2
answers1259
viewsQ: How to escape the percentage character (%) in the LIKE?
I have a system where I use the Laravel to make the query in the database. It is a search form. I use the following code: $search = trim(Input::get('search')); return Empresa::where('nome_fantasia',…
-
40
votes6
answers4038
viewsQ: What is lexical analysis?
I was taking a look at the source code of a well-known php library, called Twig (is a template engine, with its own syntax), and I came across classes, interfaces and methods, such as Lexical, Lex…
-
4
votes2
answers2629
viewsQ: How do I "turn" a specific commit into a branch?
I’d like to take one commit previous specific and turn it into a brancho. Is there any way to do that in the Git?
-
6
votes2
answers15001
viewsQ: How do I ignore a file after it’s already in a commit?
I accidentally added some images in my repository. But now I want to ignore them, but it is not obeying the data that was added in .gitignore Example: public/imagens/* How do I make a file or…
gitasked Wallace Maxters 102,340 -
4
votes2
answers2915
viewsA: How to consume this JSON with Javascript?
Because of the CORS restriction, you cannot make a request ajax common. In this case, to circumvent this problem, you can use a JSONP. In that case, I’ll illustrate with the JSONP jQuery. var url =…
-
38
votes5
answers3446
viewsQ: What is the definition of Machine Learning (Machine Learning)?
I asked that question Algorithm to detect nudity with good accuracy here on the site and some people mentioned some things about Machine Learning (Machine Learning). From what was said between a…
-
6
votes1
answer2595
viewsQ: How to use the arguments passed to a python script?
In scripts php, we can, when running from the command line, capture its values from the arguments passed through the variable $argv and its number through the variable $argc. For example (Script):…
pythonasked Wallace Maxters 102,340 -
14
votes1
answer37459
viewsQ: What is the meaning of the word "Cout" in C/C++?
Well, it is very common in programming languages to have responsible keywords for printing data output. Some are classic like echo, print, printf and write, etc.. But in the C/C++ we have the cout.…
-
3
votes2
answers1031
viewsA: Validate jpg file - Laravel 5
Here’s the problem. In Laravel, when you take an index of an input referring to an upload file, it returns an object from Symfony called Symfony\Component\HttpFoundation\File\UploadedFile\FilesBag…
-
48
votes4
answers1512
viewsQ: What is reverse engineering?
I always say I don’t get along very well with terms. These days I needed to do an operation on a given framework in PHP called Laravel, where I needed to find a resource that would allow me to use…
-
1
votes1
answer336
viewsA: Error placing Poser as global MAC
For anyone who is having this problem, it is necessary to restart your mac and press cmd + r during startup. Then go into utilities > terminal and type the following commands: csrutil disable…
-
3
votes2
answers914
viewsQ: What is the difference between a mixin and a Function in SASS
In the Sass we have two cases of reusable code snippet: function and mixin. Function example: @function border-default($color) { @return border: 1px solid $color: } Mixin example: @mixin…
sassasked Wallace Maxters 102,340 -
9
votes1
answer4488
viewsQ: What is the file with the ".css.map" extension for when I compile a Sass script?
I am learning to use Sass. All learning is going well. The only thing I don’t understand yet is that every time I compile a file .scss, it generates a file with the same name, with the extension…
sassasked Wallace Maxters 102,340 -
2
votes1
answer398
viewsA: Saving data with hasMany relationship
Whenever saving data on Laravel you need to define in the model the fields that are "fillable" in the case of $fillable. Add the table fields you want to add in $fillable. I also always change the…
laravelanswered Wallace Maxters 102,340 -
3
votes2
answers4863
viewsA: Laravel Eloquent pick only one field of a record
I’ll have to answer because other people have already fallen for that mistake. There are two classes that the Laravel can return when you make a query: Collection or the model. When the Collection,…
-
2
votes1
answer166
viewsA: Does Timthumb have security exploit issues?
The problem generally related to Timthumb is the fact that it can open external urls. In this case, opening an external url, it could open a path to a malicious script, for example. One way to fix…
phpanswered Wallace Maxters 102,340 -
0
votes1
answer300
viewsQ: What is the Traversable interface for in PHP?
In the PHP Handbook we can see that some classes can be iterated with foreach implement an interface called Traversable. For example, the class DatePeriod There, when I have implement an object of…