Posts by Phiter • 372 points
15 posts
-
1
votes2
answers131
viewsA: How to access belongsTo and hasOne in the view? - Relationship 1 - 1 bidirectional
You don’t need to loop the user array to know which user’s address is. The relationship you created should bring this information. The problem here is that you created in the database the column…
-
2
votes1
answer20
viewsA: Length Group By does not work
In this case the variable groupedYear is not an array, but an object. Only arrays have the property length. You want to know how many keys this object has, right? Then you can use the function…
-
0
votes1
answer62
viewsA: How to take the values of the property of an object created with a constructor function and group in an array?
You can get the passenger name by accessing the property value name of each passenger body. Adding a passenger, just decrease the capacity of the cart. This can be done by adding a method to this…
-
0
votes1
answer33
viewsA: Sleeping with Typescript
The problem is that when you use the setInterval, passes an anonymous function, and within Anonimas functions the scope changes, and the this refers to the anonymous function, not to the method of…
-
2
votes2
answers1125
viewsA: Should I encrypt the password before sending it to the server?
Cryptography and hashing are different things. Usually when hashing a password, you add "Salts", which are extra items added to the password before hashing to have greater security. For example you…
-
3
votes3
answers1758
viewsA: Organize array in alphabetical order
It is possible. And it is possible to simplify this code using Closures (or anonymous functions). Your problem is that the internal closure has no access to the variable $campo. This is because of…
-
1
votes3
answers72
viewsA: Filter specific file to not delete
You can use a conditional within the foreach itself, so: string[] arquivos = Directory.GetFiles(@"C:\temp\ae", "*.exe", SearchOption.TopDirectoryOnly); foreach (string arquivo in arquivos) { var…
-
1
votes1
answer374
viewsA: Web and API in Laravel 5.6
In fact, the file api.php is present since the version 5.3 of Laravel. The basic difference is that the file api.php is where you will put the routes of your api if your application is based on a…
laravel-5.6answered Phiter 372 -
0
votes1
answer1853
viewsA: How to select a specific tab by clicking the button
To change the tab, you really need the event to click the button inside the contents of the tab. Then just use the plugin itself to activate the tab you want. $("button").on('click', function(){…
-
0
votes3
answers1976
viewsA: how to center a <H2> tag vertically inside the div
You can use the transform as suggested by our colleague hugocsl, but the alignment using transform is considered a "hack" of css, because that’s not exactly what it’s for, although it works. A more…
-
1
votes1
answer646
viewsA: Modal boostrap inside Updatepanel after event click dark background
When you open the modal, the bootstrap creates a div with the following Markup, before closing the tag <body>: <div class="modal-backdrop fade show"></div> This is the div that…
-
1
votes3
answers587
viewsA: How can I sort a result in Laravel with a custom attribution from my model?
Short answer: There’s no way. The bank only understands what’s really in the bank. The only way is to replicate the custom attribute functionality in your query. In your case, you need to use the…
-
1
votes1
answer431
viewsA: How can I create a custom method in the Laravel model and match the result of another?
The problem is that the function where() does not return the class itself, returns an instance of QueryBuilder. The function search() has the following return: return $this->where(...); So you…
-
1
votes1
answer535
viewsA: Call Action as parameter in Html.Beginform - ASP . NET MVC 5
In browsers that support HTML5, you can use the attribute formaction to the Ubmit button: @using (@Html.BeginForm("ConsultaWs", "Home", FormMethod.Get)) { <text>codigo do país</text>…
-
0
votes1
answer87
viewsA: page orientation with a dropdown menu
After a search I found the code responsible for the event. $(document).ready(function(){ $("#banda a").click(function( e ){ e.preventDefault(); var href = $( this ).attr('href'); $("#div1").load(…