Posts by Amanda Lima • 3,428 points
87 posts
-
6
votes1
answer292
viewsQ: Should we create an empty constructor in Java?
It is good practice to always declare a builder, even if it is empty, for the class? I find it unnecessary, because the compiler automatically creates. I have seen people who always create and…
-
0
votes1
answer220
viewsA: Error in Spring JPQL call:
You are not paging the result of your query, but you are expecting a paginated result. Use JPA query methods for simple queries. It’ll make your life easier. here has a tutorial on how to use the…
-
1
votes1
answer313
viewsQ: Map relationship between tables without Foreign key
I have two tables in postgresql: schema1.immobile idt_imovel | int cod_imovel | string nome_imovel | string etc... schema2.declaration idt_declaracao | int cod_imovel | string status | string etc...…
-
2
votes1
answer654
viewsA: Session in Laravel 5
You can use Laravel’s own class to retrieve authenticated user data. \Auth::user()
-
-1
votes1
answer54
viewsQ: Block android features
Is there any simple way to block Android features? For example, remove Google Play, block the installation and removal of apps?
androidasked Amanda Lima 3,428 -
3
votes4
answers318
viewsA: How to get the last segment of the path?
A very simple way, without using regular expression: //Obtenha a URL sem as variáveis $url = $_SERVER['REDIRECT_URL']; //exploda $array_url = explode('/',$url); //Caso a URL termine com /, a última…
-
1
votes1
answer186
viewsQ: Create alias for columns of a table in Laravel
Is it possible to create alias for the columns name of a table in using the Laravel Model? Example: I have a table questao with the columns: id questao disciplinas_id serie_id professor_id It would…
-
0
votes0
answers83
viewsQ: Ajax request canceled by browser
I’m using a plugin for multiple image uploads, the Kartik-v/bootstrap-fileinput. On my localhost is working without any problem but when I send the application to the server and try to upload the…
ajaxasked Amanda Lima 3,428 -
3
votes1
answer1274
viewsQ: CSS formatting for PDF generation
I am using a loop to generate a PDF file. Each loop iteration should generate a PDF page. The problem is that a blank page is always coming out at the end of the generated PDF. I know this page is…
-
3
votes2
answers994
viewsA: Join in Laravel 5.x in two tables?
That’s how it works too: public function listar() { $news= News::join('autor', 'news.autor', '=', 'autor.id') ->select('news.id', 'titulo', 'conteudo', 'nome') ->get(); return…
-
4
votes1
answer1023
viewsQ: Transform String into Shell Script array
I am trying to make a script to backup my database. But I would not need to provide the name of the bases when running the script, but save each base in a different file. My script is like this:…
shell-scriptasked Amanda Lima 3,428 -
5
votes4
answers9132
viewsA: How to change the color of a select when selecting an option
A very simple jQuery script solves! What you need to do is change the css when the element is selected. $('#estado').change(function(){ $(this).css('color', 'red'); }); See working on jsfiddle…
-
5
votes5
answers32001
viewsA: JSON.parse error: Unexpected end of JSON input
I managed to solve the problem! I added this line before sending the request, stating that the response will be text type: xhr.responseType="text"; xhr.send(formData); Then I added the excerpt below…
javascriptanswered Amanda Lima 3,428 -
6
votes5
answers32001
viewsQ: JSON.parse error: Unexpected end of JSON input
I’m trying to get the answer to an xhr request: ... xhr.send(formData); var resposta = JSON.parse(xhr.responseText); console.log(resposta); ... Console shows this error: Uncaught SyntaxError:…
javascriptasked Amanda Lima 3,428 -
2
votes1
answer1492
viewsA: Blocking routes for a particular User type in Laravel 5.3
To control users' access to routes you must use middlewares. The Laravel documentation explains well how to use : https://laravel.com/docs/5.3/middleware Example: You can set in a middleware that…
-
1
votes1
answer373
viewsQ: Problem with referential integrity in Migrations (Laravel 5)
I’m having a problem using onDelete('set null') in a foreign key. You are returning the error: [Illuminate Database Queryexception] SQLSTATE[HY000]: General error: 1215 Cannot add Foreign key…
-
2
votes1
answer363
viewsQ: Problem with wherein Eloquent Laravel
I need to execute a query with the parameters as below: $questoes = Questao::leftJoin('capitulos_questoes', 'capitulos_questoes.questoes_id', '=', 'questoes.id') ->leftJoin('modulos_questoes',…
-
3
votes1
answer340
viewsQ: Search image tags inside PHP string
I have a string like: Veja o logotipo do PHP: <img…
phpasked Amanda Lima 3,428 -
2
votes1
answer347
viewsQ: Use Auth class in Laravel configuration file
I’m using the barryvdh/Laravel-elfinder. This generates the configuration file /config/elfinder.php. Inside this file, I inform the path to upload Elfinder files. I need each user to have their…
-
5
votes2
answers1012
viewsQ: Consultation with Eloquent do Laravel
I have this consultation: select Q.id,Q.questao, D.disciplina, S.serie, S.ensino from questoes as Q left join capitulos_questoes as CQ on CQ.questoes_id = Q.id left join modulos_questoes as MQ on…
-
1
votes3
answers1779
viewsQ: Many tables with little data or few tables with lots of data?
I have a bank that will receive a lot of data. I am in doubt whether it is better to organize the data into a few tables with a lot of data or further divide the data into several tables. In which…
-
13
votes2
answers6589
viewsA: What is the file . env in Laravel 5?
In the file . env the Laravel environment settings are stored. According to the documentation: Environment Settings It is very useful to have different configuration values based on the environment…
-
6
votes1
answer1308
viewsQ: Create View in Mysql through Laravel
How can I create a view in the Mysql database through migrations of Laravel? I found nothing in the documentation.
-
3
votes4
answers5110
viewsA: How to upload images using Ckeditor?
You can use the Kcfinder. It can be integrated with the Ckeditor and works well. On the official website has several tutorials.
-
2
votes5
answers2039
viewsA: How to centralize information for all Tds by CSS?
Just use: td{ text-align: center; }
cssanswered Amanda Lima 3,428 -
5
votes1
answer139
viewsA: How to use the select form on the html page
Assuming your table has one id for each collection, your code should look like this: <p align="left">Nº da Coleta <br> <?php echo ("<select name=\"colCodigo\">"); $coletas = new…
-
2
votes1
answer134
viewsQ: Problem running the Gulp
My Gulp functioned normally, from one hour to another began to present this error: The archive /var/www/html/dna/public/css/app.css is with permission 777. Contents of the gulpfile.js file var…
gulpasked Amanda Lima 3,428 -
4
votes1
answer919
viewsA: How to use Laravel paginate with a manual query?
In your model, change the get() for paginate() in the method Return getClosed(). Will stay like this: public function getClosed() { return $this->where('situation', '=',…
-
4
votes1
answer35
viewsA: Page in wordpress is being redirected to the site "official wordpress"
In the Wordpress panel go to the Settings -> General tab and enter the correct link…
-
2
votes2
answers653
viewsA: How to generate PDF with little memory on the server?
I have had the same problem. I solved using Snappy that generates PDF in a different way, using little memory. The library can be found here. Installing via Composer: $ composer require…
-
2
votes1
answer5082
viewsA: Create PDF from a LARGE HTML file with DOMPDF
I’ve had the same problem. I couldn’t find a solution with DOMPDF. With Snappy does not happen problem with file size, it is very fast! The library can be found here. Installing via Composer: $…
-
8
votes1
answer1309
viewsQ: Count number of PDF pages with Javascript
I am generating a PDF file with reports generated through PHP. In the PDF file are generated a number x of reports and each report has a number y of pages. I need to know if this y number is even or…
-
1
votes1
answer511
viewsA: Insert page break when generating PDF with Snappy PDF in Laravel 5
I solved the problem by adding the class: .page-break{ page-break-after: always; } on the spot where I wanted the break.
-
1
votes1
answer511
viewsQ: Insert page break when generating PDF with Snappy PDF in Laravel 5
I am generating a PDF in Laravel using Snappy PDF. The problem is that it is not breaking the page in the place it should. I’ve tried using the page-break-after: always of the CSS in the place where…
-
2
votes0
answers358
viewsQ: Problem when placing Application made in Laravel 5.2 in production
I’m not putting my system into production. I created a Virtualhost in the file http.conf Apache with the following configuration: <VirtualHost *:80> DocumentRoot /var/www/html/dna/public…
-
4
votes2
answers176
viewsQ: Manipulating Javascript window.history
Is there any way to list the URL’s of window.history? If I want to use window.history.go(-2), has how to know which URL this -2 will return?
javascriptasked Amanda Lima 3,428 -
3
votes1
answer53
viewsQ: Remove first <p> tag and last </p> string tag with jQuery
I have a string with several HTML tags. I want to remove only the first tag <p> and the last tag </p> of this string. I found solutions that remove all tags but these do not serve.…
-
1
votes1
answer326
viewsQ: Calling method within URL in Laravel
I have a page with a "back" link. Is there any way to call the method back() of Laravel within the href of the link? That code doesn’t work, but I want something like href="{{URL::to(back())}}"…
laravel-5asked Amanda Lima 3,428 -
5
votes1
answer7321
viewsQ: How to pick attributes from an option field with jQuery
I have the following code: <select name='exemplo' id='exemplo'> <option value='1' class='teste' dado='a'>1</option> <option value='2' class='teste' dado='b'>4</option>…
jqueryasked Amanda Lima 3,428 -
5
votes2
answers1476
viewsQ: Transforming Multidimensional Array into One-Dimensional
How to turn this array into PHP: array:6 [ 0 => array:1 [ "EF1A" => "00001" ] 1 => array:1 [ "EF2A" => "00001" ] 2 => array:1 [ "EF3A" => "00003" ] 3 => array:1 [ "EF4A" =>…
phpasked Amanda Lima 3,428 -
7
votes1
answer6501
viewsQ: Sending email with Laravel 5.2
I’m having trouble emailing with Laravel 5.2. You’re returning this mistake to me: Expected response code 250 but got code "530", with message "530-5.5.1 Authentication Required. The archive .env is…
-
0
votes5
answers150
viewsA: Doubt with image positioning
Another option would be: .relative{ display: table; margin: 0 auto; }
-
1
votes1
answer180
viewsA: How to integrate Kcfinder with Laravel?
I was able to solve the problem by placing the Kcfinder folder inside Laravel’s public folder. I was putting it inside the Ckeditor folder, so the Urls didn’t work
-
2
votes1
answer180
viewsQ: How to integrate Kcfinder with Laravel?
I am making a form where the user can insert an image along with the text. Searching the internet I found Kcfinder that does exactly what I need. I integrated it with Ckeditor and so far so good.…
-
3
votes1
answer1045
viewsQ: Remove old Mysql records automatically
I have a table that stores logs from a system. I want some method to automatically delete logs older than 60 days. It has how to do this?
-
2
votes1
answer5684
viewsQ: Manipulating Base64 images with PHP
I have some Base64 encoded images in PHP. I need to resize these images by setting a maximum size for them before storing in the database. How can I do that?
-
4
votes1
answer2270
viewsQ: Hide part of a text with javascript
I have a table that is filled with data from a bank. One of the columns contains text that is sometimes long ( more than 1000 characters). I want to limit the display of this text in the table to…
-
2
votes1
answer353
viewsQ: PHP function always returning NULL
I have a function in PHP that is always returning NULL and I’m not able to understand why. The variable I’m trying to return is a multidimensional array. When I give a var_dump in the variable it is…
phpasked Amanda Lima 3,428 -
1
votes1
answer228
viewsA: Problem with SQL Server connection
The problem was fixed by reinstalling the php-mssql module on my local server.
-
3
votes1
answer228
viewsQ: Problem with SQL Server connection
I have a PHP system hosted on a Linux server that queries a SQL Server database through the mssql. It works perfectly on the server. I needed to make some changes to this system, so I put it on my…