Posts by Diego Souza • 16,524 points
642 posts
-
1
votes2
answers332
viewsQ: Save Date in UTC Brazil Table
I’m making an insert into a Mysql table that contains several date fields. I left in the default column created_at table the value current_timestamp. If I make one INSERT now, it is inserting:…
-
0
votes0
answers212
viewsQ: Slider Loading Problems - Height
I’m using a plugin to make a slider, called Slick. http://kenwheeler.github.io/slick/ I’m leaving the image of the slider with width: 100% so that the image is good from the resolution 1280px. But…
-
0
votes1
answer150
viewsQ: Bring Records You Don’t Have - 3° Table
Scenario, four tables. TABELA A | TABELA B | TABELA C | TABELA_D ID_A ID_B ID_A ID_B ID_D ID_D DESC 1 10 1 10 1 1 PEÇAS 10 1 2 SERVIÇOS 10 1 3 COMPRA The first table has the PK Id_a. The second…
mysqlasked Diego Souza 16,524 -
1
votes1
answer51
viewsQ: Bring Existing and Non-existent Records
I got the next thing: $consulta = Dealer::find(1); No Model # Serviços public function dealer_servicos(){ return $this->hasMany('App\DealerService', 'id_concessionaria'); } So if I do:…
-
0
votes2
answers52
viewsQ: Column Not Found With Inner Join
Lines: 1 - Data from filter form 2 - That with i enter a Model relationship function. I do this because I need to sort my list by column order MEDIA. 3 - The strange thing is that I need to do an…
-
3
votes2
answers62
viewsQ: Callback in Having
In Laravel it is possible to make a callback at the time of a consultation. For example: $q = Model::where(function($query){ $query->where(...); }); I’d like to do something similar, but with the…
-
6
votes2
answers1007
viewsQ: How to Filter Multiple Fields in the Query?
I need to make a filter in a query in Laravel. How can I do this in the best way ? For example, I have a query on my page and I want to filter it. For this I have a column that has some filter…
laravelasked Diego Souza 16,524 -
0
votes0
answers231
viewsQ: How to Redirect CNAME to Hosting
I am trying to redirect a domain and a CNAME to an IP at Locaweb. It is a cloud server that generates a temporary link to access the site from the browser. Let’s assume:…
-
4
votes1
answer347
viewsQ: Two __Construct() Functions in the Same Project
I can’t have two functions __Construct() in my project Laravel ? There is one in Controller.php and wanted to build one __Construct in another Controller. Just give me variable errors on the…
laravelasked Diego Souza 16,524 -
1
votes0
answers60
viewsQ: Error while Sending E-mail
How do I deal with that mistake ? This error is when I try to send an email via Localhost on Laravel. Online works. But I’m afraid that online error will happen too. I want to be able to handle;…
laravelasked Diego Souza 16,524 -
4
votes1
answer605
viewsQ: Problem Recovering User Geolocation
I’m having trouble retrieving user geolocation on the site. Localhost works, but not on the network. I’m guessing the problem is that it has no SSL certificate and the site is accessed by HTTP and…
javascriptasked Diego Souza 16,524 -
2
votes1
answer23450
viewsA: How do I load an external source into a CSS/HTML document?
The way you are doing it is somewhat wrong. See the example below: @font-face { font-family: 'Calibri'; src: url('fonts/Calibri.eot'); src: url('fonts/Calibri.eot?#iefix')…
-
0
votes1
answer65
viewsA: Style in cluttered list
Because you typed the class name in the wrong CSS: .menuPrincpal IS .menuPrincipal - the letter was missing i.
-
-1
votes2
answers833
viewsA: Footer does not appear on the first page - Laravel Dompdf
See if it works. <?php $head = '<html><head> <title>Relatório</title><style type="text/css"> @page{ margin: 120px 50px 80px 50px; } .head{ font-size: 12px; height:…
-
3
votes2
answers423
viewsA: how to align center with css
Other Way HTML <div class="btns"> <button type='submit'>bt1</button> <button type='submit'>bt2</button> </div> CSS .btns{ text-align: center; } button { display:…
-
1
votes1
answer86
viewsA: Laravel Template Help!
master.blade.php <!DOCTYPE html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title></title> <meta name="description"…
laravelanswered Diego Souza 16,524 -
1
votes1
answer27
viewsQ: Pick up Remaining Records
It has a function in Laravel’s ORM that makes the LIMIT of Mysql. Which is the Take and the Skip. I’m going to do three Owl Sliders on the page, one under the other. And the images I’m going to put…
mysqlasked Diego Souza 16,524 -
2
votes1
answer241
viewsA: How to make a "select distinct" on a model in Laravel?
Using GroupBy() $amostragens = Amostragem::select('id', 'analito')->groupBy('analito')->get(); Using Distinct() Fluent DB::table('amostragem')->distinct()->get(['analito']); Eloquent…
-
0
votes0
answers97
viewsQ: Sort Secondary Table Column
Categoria Segmento 1 Atendimento 1 Tempo de espera pela peça 1 Preço 2 Atendimento 2 Negociação 2 Tempo de entrega do veículo 3 Atendimento 3 Preço 3 Serviço I have a table where I save some data in…
mysqlasked Diego Souza 16,524 -
0
votes1
answer43
viewsA: Add multiple lines with jQuery using . text
You have to add the new message after the content that already exists. Otherwise, it really overlaps. Try this below. If it goes wrong, remove the parentheses from text(). $chat.append($chat.text()…
-
1
votes2
answers1235
viewsA: Anchor Link Edge or Positioning
Put a - 20 after . top. scrollTop:$(this.hash).offset().top - 20 So it positions -20 pixels of your element.
-
1
votes2
answers439
viewsA: Laravel Ordination with Relationship
Solved. I did with Eager Loading, was the only way. # Pesquisar na Base de Dados a Consulta do Usuário $consulta = Dealer::with(['order_avg']) ->leftJoin('dealer_ratings', function($q){…
laravelanswered Diego Souza 16,524 -
2
votes2
answers78
viewsA: Hide controls for flash (swf)?
It is in the object. Put inside: <param name="menu" value="false" /> And within the tag embed place: menu="false"…
-
5
votes1
answer7311
viewsA: How to select in the database involving Foreign key and Primary key?
Rotate that query: SELECT NOME, EMAIL, NOME_CARGO, TIPO_CARGO FROM FUNCIONARIO INNER JOIN CARGO ON CARGO.ID = FUNCIONARIO.ID_CARGO WHERE EMAIL = '[email protected]'…
-
1
votes1
answer60
viewsA: Function imagecreatefromgif does not take
Does not catch because the link image is PNG and you are using the function to catch it in GIF. After picking it up you can convert it to GIF. <?php header("Content-Type: image/gif"); $img =…
phpanswered Diego Souza 16,524 -
0
votes2
answers410
viewsA: Ajax request error to load in google map
You need to include this: <script src="https://maps.googleapis.com/maps/api/js?key=SUA_KEY&callback=initMap" async defer></script> ... in place of what you placed without setting a…
-
0
votes0
answers490
viewsQ: Several Ajax Requests
I just did a routine to rescue information from Google Maps using your API. But I needed to use CURL in PHP to make the request, because when I do it directly in AJAX in JS, accuses me the error of…
-
1
votes2
answers439
viewsQ: Laravel Ordination with Relationship
I’m looking to make a related consultation, but the ordering should be done by a field from another table that is in the relationship. $consulta = Dealer::whereIdMarca($codMarca)…
laravelasked Diego Souza 16,524 -
0
votes1
answer1024
viewsQ: Return JSON Function Data and Populate DIV
I want to learn how to recover the data from a function that does a GET in an API and returns me the JSON. I want to recover the data and fill in a list... with the ng-repeat. Is going to come…
angularjsasked Diego Souza 16,524 -
1
votes1
answer139
viewsQ: How to Rescue JSON External Data
I’m learning Angularjs from Apigility. I’m having some doubts and I think I can only understand by asking... I have this code here: App.controller('ListaCtrl', ['$scope', function($scope){ $scope.id…
angularjsasked Diego Souza 16,524 -
0
votes2
answers536
viewsA: Make an HTML checklist
.box_parceiro { background-color: $cor_padrao; } .box_parceiro:nth-child(2n+1) { background-color: $cinza_noticia_home; }
-
3
votes0
answers59
viewsQ: Image Dimension Validation with jQuery Validation
Even selecting an image in the correct dimensions is giving me error warning that I am not selecting an image in the right dimensions. How do I return this function to not enter error ? jQuery…
jqueryasked Diego Souza 16,524 -
0
votes2
answers1860
viewsA: Remove array element
unset($produto[0]) Where what’s in square brackets is the index. Or search for the value in the array, find the key and remove. $key = array_search($string, $array); if($key! == false){…
phpanswered Diego Souza 16,524 -
0
votes1
answer120
viewsA: Set Result Even If Record Does Not Exist
I solved. I created a table to save the status and made a leftJoin. $totalRating = DealerStatusRating::leftJoin('dealer_ratings', function($query) use ($idDealer){…
-
0
votes1
answer120
viewsQ: Set Result Even If Record Does Not Exist
I’m trying to make a query where the table shows the column with the total 0 even if there are no records in that given status. For example: SELECT STATUS, COALESCE(COUNT(ID), 0) AS TOTAL FROM…
-
2
votes2
answers325
viewsA: How can I execute this query with Laravel 5?
This way is with Inner Join. But if you want something even more organized, do what Wallace posted. <?php $anuncios = Categoria::orderBy('cat-nome') ->join('anuncios', 'anuncios.cat-id', '=',…
-
2
votes1
answer507
viewsA: Problem with . htaccess, subdomain
In Laravel root folder, creates a . htaccess file with this code: Add these two lines in the . htaccess folder public_html RewriteEngine On RewriteCond %{HTTP_HOST} ^(www\.)?claradvl\.com$ [NC]…
-
4
votes1
answer400
viewsQ: Check which field already exists in the table
I’m making a query in Laravel to see if the user with the email, CPF or username entered already exists in the database. # Verificar se Usuário Já Existe na Base de Dados $verUser =…
-
2
votes1
answer150
viewsA: Share Content on Facebook
Just add this tag: <meta property="article:author" content="https://www.facebook.com/seu-perfil-facebook" /> But the value of content must be a Facebook profile.…
-
1
votes2
answers83
viewsA: Take All Records and Separate by Status
I solved it like that, in logic anyway. @foreach($res->dealer_medalhas as $item => $key) <?php $arrM['id'][$key->medalhas->id] = $key->medalhas->id;…
-
2
votes2
answers83
viewsQ: Take All Records and Separate by Status
Dealer.php class Dealer extends Model { # Relacionamento com Medalhas public function dealer_medalhas(){ return $this->hasMany('App\DealerMedal', 'id_concessionaria'); } } Dealermedal.php class…
-
2
votes1
answer150
viewsQ: Share Content on Facebook
To share a piece of content on Facebook I’m using the Facebook SDK API. These are articles on the site that will now have this sharing feature. I am doing so: <meta property="og:url" content="{!!…
-
0
votes1
answer107
viewsQ: Directional Arrows in Object
I did a city search using Javascript. There is a text field in which the user type the city name. And as he’s typing the letters, the respective cities that start with that letter appear in a ul…
-
1
votes1
answer1255
viewsA: Foreach Ajax for combo
The return should be on json. return json_encode($cidades) JS var box_select = $('#cidades'); var estado = $(this).val(); $.ajax({ dataType: 'json', url: urlBase + '/busca-cidades', type: "POST",…
-
6
votes2
answers946
viewsQ: AJAX Javascript Pure Asynchronous
I am trying to recover a data coming from Ajax to use in another function, but I am not succeeding. In jQuery I do this using a parameter called async: false. But in pure JS I am not able to do. The…
-
0
votes2
answers586
viewsA: Select All NULL and NOT NULL Records
I got. SELECT ID_LOJA, MEDALHAS.ID, ID_MEDALHA, MEDALHA, CASE WHEN LOJA_MEDALHAS.ID_MEDALHA IS NULL THEN 'NÃO' ELSE 'SIM' END AS SITUACAO FROM MEDALS LEFT JOIN LOJA_MEDALHAS ON…
mysqlanswered Diego Souza 16,524 -
0
votes2
answers586
viewsQ: Select All NULL and NOT NULL Records
I have two tables: Medals and Loja_medals. I want to bring in just one SELECT all medals and create a column to put your situation. Would be two status, Yes and In the. The structures: MEDALS ID…
mysqlasked Diego Souza 16,524 -
2
votes1
answer992
viewsA: How to Create Tabulated Data with Link View More?
Solved. I made a CSS and a little bit of jQuery. CSS ul { li { &:nth-child(n+5){ display: none; } } In the code above I show only 4 lines. HTML <div class="btn-ver-mais"> <span>Ver…
-
0
votes1
answer992
viewsQ: How to Create Tabulated Data with Link View More?
I’m pulling from the database records of a certain table. I want to show only 4 out of 4 records on the screen. But I would like to pull them all at once instead of paging (1, 2, 3, 4). I want to…
-
1
votes0
answers75
viewsQ: Is It Possible to Make Two Authentications in the Same Laravel Project?
In Laravel we have the function Auth() that works with every part that an authentication needs. I am developing a project that will be logged in to the Front-End (for individual customer use) and…
laravelasked Diego Souza 16,524