Posts by Kaique Prazeres • 377 points
26 posts
-
-1
votes4
answers486
viewsA: How would an algorithm work to prevent attempts to trick word blocks (strings)?
How an algorithm would work to prevent attempts at deception word blocks (strings)? It could work 3 ways: 1st - Using a list of forbidden words with reference to what has been reported. This…
-
-1
votes5
answers73
viewsA: Calculate date difference and print these days
You can use the class DateTime PHP and the simple algorithm below. First you instantiate the dates Use the method diff to calculate the difference in days Call the public attribute d to obtain the…
-
1
votes2
answers681
viewsA: SOA x Microservices
According to Sam Newman (author of some books on the subject) the difference between them is in the communication protocol, in the implementation, flexibility for changing technologies, independent…
-
0
votes1
answer310
viewsA: Taking ownership of an object with jquery and changing its style with css
You can use the method css()jQuery bilioteca to apply styles to the desired element. In this way: var pegaObj = $(config).css({"line-height":"1", "width":"250px"}); Or if you prefer, you can create…
-
1
votes1
answer343
viewsA: Page and data redirection with Ajax
The way you’re doing the job header()will not be interpreted and redirection will not occur in response to an asynchronous request. This is because response headers have already been sent before PHP…
-
7
votes1
answer72
viewsA: Count counting it wrong?
Count is returning zero because the variable name is wrong. Note on the first call: $exitente = $membrosDao->pesquisaMembrosNasFuncoes( $_POST[ "idMembro" ] ); The variable name is $exitente And…
-
0
votes1
answer463
viewsA: How to delete content from TXT file using PHP?
You have another alternative. You could invoke the function using a form button. And for him to look cool, he could style with css. For example: HTML form <form action="/urlaqui"…
-
1
votes1
answer392
viewsA: How to make Foreign Keys using Migrations Laravel
You forgot to set the column user_id. Note that you just set user_id as Indice, but did not create the column before that. Schema::create('permissions', function (Blueprint $table) {…
-
1
votes1
answer43
viewsA: What is the real benefit of using Controller Resource in Laravel?
The benefit of using resource-type controllers is in the statement itself and in the context. Since this type of single route declaration creates multiple routes to handle a variety of actions from…
laravelanswered Kaique Prazeres 377 -
0
votes1
answer49
viewsA: Error generating PDF, Undefined variable: o (View:
Note that the warning indicates that the variable "$the" is undefined. That is, it does not exist. This warning is displayed every time you try to use a variable that does not exist. And in your…
-
1
votes1
answer484
viewsA: Is it possible to create an internal search of a website without using PHP and database?
It is possible yes, however, you need to have a data source. It can be an array, a file with the data that will be used in the search. And for that you can create using javascript and html. Follow…
-
2
votes1
answer74
viewsA: What is rel="noopener"? Should I use it on all links on my site? Can it affect SEO?
Without this, the new page can access your window object via window.opener. Fortunately, the web source security model prevents it from reading your page; unfortunately, for some legacy Apis it…
-
1
votes1
answer1626
viewsA: Array to string Conversion, Orange Validation
The exception’s own message already tells you what’s going on. Cannot convert array to string because the "img" field is an array. Every file field generates an array in php. Thus: $_FILES['img']…
-
0
votes1
answer240
viewsA: What is the best way to calculate between attributes of a model, to display in the view?
Create methods with the return of the calculation in the model and pass the method to view through the controller. Example: No Model: public static function calculo(Object $object) : float { return…
-
-1
votes1
answer285
viewsA: Image in blob does not appear
Well, first of all, to insert a blob file into the table, you need to use the native php function file_get_contents(). Exemplifying: "INSERT INTO tabela(imagem) VALUES ( file_get_contents($imagem)…
-
1
votes1
answer741
viewsA: Laravel 5 Pagination without "refresh"?
You can use the dataTables. However, there is an abstraction of the same for the. I will write a tutorial on how I implemented it very simply and quickly, but without addressing all the technical…
-
1
votes1
answer529
viewsA: Laravel Email Sending Configuration 5.1
Do the following: Log in https://mailtrap.io/ and create an account. After that, open the file .env and set the following settings: MAIL_DRIVER=smtp MAIL_HOST=smtp.mailtrap.io MAIL_PORT=2525…
-
-2
votes1
answer402
viewsA: How to return data array with Join in Laravel with the DB class?
$process = $db->table('processo')->where('nrprocesso',$id) ->leftJoin('viatransporte', function($viatransporte){ $viatransporte->on('processo.idviatransporte', '=',…
-
1
votes1
answer69
viewsA: Laravel Controller?
Remember not to hurt the principles of architectural patternthe MVC. Controller only coordinates communication between Model and View. It should not know implementations and should not contain…
-
0
votes1
answer52
viewsA: How To Use Where IN in Query
There’s another apparently simpler way to do what you want: $dados = DB::table('tabela')->whereIn('id', [1, 2, 3])->get(); For more information: https://laravel.com/docs/5.7/queries…
-
2
votes1
answer1324
viewsA: What’s the lighting for?
Illuminate is part of the logical path (namespace). It is as if it were a "folder", however, the goal is to logically group the entities of the framework. Specifically "Illuminate" otherwise I am…
laravel-5answered Kaique Prazeres 377 -
0
votes1
answer1009
viewsA: Send contact to email with Laravel?
Do the following: Log in https://mailtrap.io/ and create an account. After that, open the file .env and set the following settings: MAIL_DRIVER=smtp MAIL_HOST=smtp.mailtrap.io MAIL_PORT=2525…
-
-3
votes2
answers1897
viewsA: How to do a subquery in eloquent Laravel with WHERE
Use this as a reference. $q->where('campo1', function($q) use ($campo2) { $q->from('tabela') ->selectRaw('min(campo1)') ->where('campo1', '>=', $campo2) ->where('campo3', $campo3);…
-
1
votes1
answer186
viewsA: Datatables processes only one request
Datatables expects a Json in response to requests. And Datatable itself has a component that helps to manipulate the data through request. $table = 'datatables_demo'; // Table's primary key…
-
0
votes1
answer57
viewsA: Error sending form by pressing Enter - PHP
Following what the message says, some variable with the name "log in" has not been defined. Try to use something like: if( isset($_POST['logar']) ){ // Seu código } This will cause the existence of…
-
0
votes4
answers2176
viewsA: What are they for and why do they nest the DIV tag?
Div is an HTML tag. More precisely an element that behaves like a block. Often used to structure a page layout / template. In HTML there are tags that behave as Block and as line. Examples of…