Posts by David Dias • 995 points
63 posts
-
0
votes1
answer75
viewsA: Column Mode Insertion in Visual Studio Code
What makes there a column in a plain text file is the spacing. In this case there, it is not so simple to leave exactly the same, but can do something like the example below: After selecting all the…
visual-studio-codeanswered David Dias 995 -
0
votes1
answer58
viewsA: What is the difference between executable files generated using chmod and those generated from a compilation?
When you use the chmod with the +x in some file, you are not necessarily turning it into executable. In fact you are saying that this file will now have permission to be executed. In the case of…
linuxanswered David Dias 995 -
1
votes2
answers378
viewsA: Why is it necessary to raise ng in 0.0.0.0?
This is not necessarily in relation to the Angular, it is more related to the network and Docker. When using the 127.0.0.1, you are telling your server to listen/serve to the virtual network adapter…
-
0
votes1
answer204
viewsA: Laravel Error | Methodnotallowedhttpexception
In the Laravel, the request method is identified by the attribute _method. If you want to access the @store Controller, you can simply send a POST, however, if you want to access the @update you…
-
0
votes1
answer208
viewsA: How to save radio input inside an Laravel table
To update the Model instance in Laravel, you can use the following syntax: RequisicaoDet::find($id)->update([ 'atendecompra' => $request->get('atendecompra') ]); It wasn’t very clear why…
laravelanswered David Dias 995 -
2
votes1
answer178
viewsA: v-model does not work in vuejs
I found that this is some conflict with Jqmigrate and is only locking the selects, has nothing to do with vuejs. To find out this, I tested the v-mode on another element and it worked, just as if I…
vue.jsanswered David Dias 995 -
0
votes1
answer178
viewsQ: v-model does not work in vuejs
In a simple test in Vue.Js, following the example of documentation, span never displays the data selected by select. select is mounted by Vue, but the variable select is not mirror. <div…
vue.jsasked David Dias 995 -
0
votes1
answer45
viewsA: Doubt relationship One to Many
You can make the processes separate, since the Person is never client and professional at the same time. Example: factory(App\Pessoa::class, 5)->create()->each(function ($u) {…
laravelanswered David Dias 995 -
0
votes1
answer113
viewsA: How to take the absolute path from the Side of the View?
Create a Filter to make the View name available on its own. filters.php /** * Compartilha a globalmente variavel $view_name com o nome da view corrente */ View::composer('*', function ($view) {…
laravelanswered David Dias 995 -
0
votes1
answer113
viewsQ: How to take the absolute path from the Side of the View?
Laravel 4.2 I need to get the directory of . Full Slide after its rendering, how to do this? I have been trying to navigate through the Application, this seems to be a bad idea, however I have not…
laravelasked David Dias 995 -
0
votes2
answers750
viewsA: How to use with on the return of a DB::Select - Laravel
Jilcimar’s answer solves for cases where you can make the query from the Model itself, in my case I wanted to make the combination of Joins first-rate. To solve this, the Laravel has a method called…
-
0
votes1
answer121
viewsA: Search reversed in Select2 without using Ajax
In the Select2 this feature does not exist natively and I had no results doing manually, despite being able, the performance was not cool. By insisting on the searches, I found an alternative that…
jquery-select2answered David Dias 995 -
-1
votes1
answer121
viewsQ: Search reversed in Select2 without using Ajax
In Datatables.js the search works this way: Product Name: Meias Vermelhas The search returns the item if you type: Vermelhas Meias How to have the same search efficiency as Select2? Ref:…
jquery-select2asked David Dias 995 -
0
votes1
answer66
viewsA: Onesignal requesting URL with APP_ID from SDK?
In Onesignal’s doc, the call for this is different: https://documentation.onesignal.com/docs/web-push-sdk var OneSignal = OneSignal || []; OneSignal.push(["init", { appId: "YOUR_APP_ID", // Your…
onesignalanswered David Dias 995 -
1
votes2
answers750
viewsQ: How to use with on the return of a DB::Select - Laravel
To get the information, is being using a DB::RAW thus: That’s in the Repository. Already in Controller, I would like to use the with to bring the relationships made in the Model: But the DB::select…
-
2
votes1
answer56
viewsQ: Use of Trait in static method
Taking the example below, how can the Trait within the method static class? Is it possible? How? Is it bad practice? What is the right way? trait TestTraits { public function thistraitmethod($data)…
-
0
votes3
answers536
viewsA: Why can’t I pass summernote name="" via ajax
textarea does not return in .val(), use: var dica = $('#dica').text();
-
0
votes2
answers1441
viewsA: How can I not allow the browser to save the password entered?
In the case of your example, the authentication is done by ajax and does not execute the form Submit, preventing the browser from storing the password. For other cases, you can use the…
-
0
votes1
answer64
viewsQ: How to Create a Truly Global Scope
It is possible to create global scopes for Models, but even if it is Global, it is still necessary to specify within your Model that it will have this implementation. I want to create a global scope…
laravelasked David Dias 995 -
0
votes2
answers394
viewsA: Send URL parameter of a table to a modal
You need to use JS for this, because the modal does not traffic data by default. You can do all this with just JS, but to simplify, I’ll give you an idea of how to use the minimum JS and simplify…
-
1
votes1
answer65
viewsA: Command does not work when executed via cronjob
Escape the %: "[\%Y-\%m-\%d \%H:\%M:\%S]" Read more here Alternative: Create a file with what will be executed by routine: executarotish. #!/bin/bash sudo sh…
-
8
votes2
answers1093
viewsA: Replace empty or blank letter, something like Replace("letters","")
You can just take the numbers and don’t have to do the rest Replace: p.ZC_CELULAR = Regex.Replace(reader["A1_ZTEL"].ToString(), "[^0-9]", ""); Or: p.ZC_CELULAR =…
-
0
votes0
answers403
viewsQ: How to have a good identation of . Blade in Vscode?
Example of expected result: <body> @extends('t') @include('as') </body> Example of Reality with PHP extension <body> @extends('t') @include('as') </body>…
-
1
votes3
answers411
viewsA: Pick last element attribute date from a list
To catch the last element you can use the selector :last For example, to take the last line of a table: $('table tr:last') Note that your append already enters in the last position, then the :last…
-
1
votes2
answers67
viewsA: jQuery bring value from Mysql table
To do this dynamically you will need to use Ajax. Create a file/route to insert and return what was inserted. jQuery.post('linkparacadastrarMusica', {nome: nomedaNovaMusica}).done(function(data){…
-
1
votes1
answer179
viewsA: Laravel 5.4 (1/1) Tokenmismatchexception
Your application is not creating session/cookie in the browser. This prevents you from validating the token. I can’t explain the exact reason but it has happened to me. To resolve this, you need to…
-
0
votes2
answers120
viewsA: Timeout for query execution
An idea of how you can do it: Create a file that will be responsible for the query alone, as if to schedule a task. In the main file, where you run it today, it will do nothing but pass the…
phpanswered David Dias 995 -
2
votes1
answer266
viewsA: Login error when trying to upload project from Android Studio to Github by IDE
Via Token: Go on Developer Settings and then in Personal Access Token Click on Generate New Token and create the Token: Copy Token and paste it into Android Studio authentication.…
-
1
votes1
answer619
viewsA: Send data via post
You need to remove the bar in POST calls. If there is a bar at the end, the request magically converts to GET. http://localhost/controle/api/pessoa I confess that I am not sure if the change of this…
-
0
votes1
answer49
viewsA: Return of a function in another Class
Whereas you will use the data_hora_atual within the fazSessao, for example only: Two alternatives: Turn the function into statics: function static data_hora_atual($par,$conexao){ } And in Class…
-
1
votes1
answer25
viewsA: Render html for multiple folders on the server
In a simple and non-technical way, but that gives you room to advance: Point the DNS of all domains to the same server; Configure the web server (Nginx/apache/iis) to direct ALL to the same…
-
4
votes1
answer127
viewsA: How to monitor a URL when there are changes?
Monitoring the URL itself is not done without a query to it. Unless the website informs you that there has been a change, you will only know if you are going to consult. I’ll explain some idea on…
-
1
votes1
answer1603
viewsA: List ftp folder with php
Try enabling passive listing mode: // Habilita o modo Passivo ftp_pasv($ftpconn, true); // Recebe lista dos arquivos do ftp $lista = ftp_nlist($ftpconn, '/'); // Imprime var_dump var_dump($lista);…
-
1
votes3
answers42
viewsA: Doubt about standard JS code
Here he created a kind of class, actually an object with functions. So he can centralize what the projeto can make and use anywhere else. var projeto = { methods: { funcao1: function() { }, funcao2:…
javascriptanswered David Dias 995 -
1
votes4
answers3601
viewsA: Check if input file is with file or not
if ($('#arquivo').files.length === 0) { alert("É Obrigatório Anexar Seu Currículo!" ) }
-
2
votes1
answer28
viewsA: PHP or JS - Hide Name with more than X careteres
PHP: $string = "OLA SOU FIXE LALALA"; $metade = strlen($string)/2; echo substr($string , 0, $metade).'...'; JS: var string = 'OLA SOU FIXE LALALA'; var metade = string.length/2; alert(…
-
1
votes1
answer326
viewsA: How can I send a PHP variable on one page to another Javascript page using Ajax?
What you are being part of the concepts used in a REST API. See here Backend is in charge of managing and providing the data in a practical format like json, from there, the responsibility of…
-
0
votes2
answers56
viewsQ: Create OR Update -> Mysql
There is something 'native' from MYSQL that does an Update OR Create? Something that is more performative than SELECT, validation and INSERT/UPDATE as is normally done. I do not refer to methods…
mysqlasked David Dias 995 -
0
votes2
answers97
viewsA: Application consuming too much server resource
I will put together some ideas for this optimization here, in order to assist or start the debate on some of them. I believe you won’t have a cake batter solution in this case, we’ll need to test.…
-
2
votes1
answer298
viewsQ: How to use Bootstrap shortcuts in Vscode on. Blade files?
There is an extension called Bootstrap 3 Snippets, but it only executes snippets in HTML files. How to make it work in other extensions files?
-
2
votes1
answer298
viewsA: How to use Bootstrap shortcuts in Vscode on. Blade files?
Use the extension snippets manually: Access and copy content from: https://raw.githubusercontent.com/wcwhitehead/bootstrap-3-snippets/master/snippets/snippets.json Go to Snippet your Vscode: Click…
-
1
votes1
answer291
viewsA: How do I take a view image (html) and send it to a controller (php) using codeigniter?
Sending via POST with jQuery: var img_url = 'linkgeradoGcharts' $.post( "suarota", { img: img_url } ).done(function(data){ alert(data) }) Getting the request on Codeigniter:…
-
0
votes2
answers445
viewsA: Make pop-up open after a while
I have kept only what will make the element open: setTimeout( function() { $('.popup-overlay, .popup-banner').fadeOut(400); },3000) This causes the click function to stop working, since the idea is…
javascriptanswered David Dias 995 -
1
votes2
answers281
viewsA: Retouch several items of a relation - Laravel
This will depend a little on the relationship, but this can help you: Model Courses, whereas there is a Student Tablecourses dealing with relationships: class Cursos extends { public function…
-
1
votes1
answer28
viewsA: Conflict with this I get in function when I click, with this from AJAX
Just one example, but I believe it makes it easier to interpret. var thisdobotao = this; var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { var thisdafuncao = this;…
-
4
votes5
answers1659
viewsA: What is the best way to pass data between php files
The Controller’s function is actually just to handle HTTP calls to the application. An alternative for you would be to pass the business rules to a layer (directory) called Services. So you…
-
1
votes1
answer72
viewsQ: Mutator as Standard Attribute
I have a mutator similar to this: public function getLastTotalAttribute() { return $this->produto->sold_on_register; } I want the last_total attribute to be automatically generated in the…
laravelasked David Dias 995 -
0
votes1
answer111
viewsA: Execute ajax on page with more than one form
The problem is in the form selector. $(document).on("submit", "#quitar_debito", function(event) Try: This will take all the forms in the document: $(document).on("submit", "form", function(event)…
-
0
votes1
answer37
viewsQ: Dynamic attribute name in Post Jquery
How can I use the type variable data as the title/name of the attribute that will be passed in POST? The type is dynamic because it is actually the name of the column in the database.…
-
0
votes1
answer6084
viewsA: Consume api with Laravel
Regardless of what your Framework is, before consuming something you need to understand what it is to actually consume an API. This will make it easier. Behold: An API is nothing more than a set of…