Posts by Renan Chaves • 68 points
10 posts
-
0
votes1
answer58
viewsA: Laravel when loading a relationship does not appear when returning as json
I managed to get around the situation by overwriting the model toArray public function toArray() { return [ 'id' => $this->id, 'name' => $this->name, 'price' => $this->price,…
-
0
votes1
answer58
viewsQ: Laravel when loading a relationship does not appear when returning as json
When trying to load a product’s images are not included when returning Model: class Product extends Model { public function images() { return $this->hasMany(ProductImage::class); } } Controller:…
-
1
votes2
answers59
viewsA: Codeigniter - Search Mysql and show registration amount
You can use the $this->db->count_all('nome_tabela'); or Voce can do a Count in its result count($query->result());
phpanswered Renan Chaves 68 -
-1
votes3
answers228
viewsA: How to move a cursor as user type?
Hello it is possible to do through CSS, in the element you need put the following CSS cursor: none; In case you need to add in everything. *{ cursor: none; }…
-
2
votes1
answer972
viewsA: Laravel: Pass parameters on routes
From what I understand you will do by GET just pass the parameters with bar equal to this example: Route::get('/rota/{parametro1}/{parametro2}', 'MeuController@minhaFuncao')->name('dashboard');…
-
-2
votes3
answers236
viewsA: Job scheduling and publishing
I do not know much but you may be using CRONTAB to schedule execution of php scripts, this in linux it is as if it were windows services.
-
-1
votes1
answer91
viewsA: PHP iframe opening more than one session for the same browser
It was necessary to put a setTimeout in javascript to make the requests because my sessions were being saved in files so the delay in updating.
-
0
votes2
answers63
viewsA: Best way to select a specific column that is within a Function ($query)
Try using the select public function buscarPorId($id) { //$id_admin = Credencial::recuperarIdAdmin(); return $this->produto->with('descricao') ->with('produtoMarketplace')…
-
2
votes4
answers440
viewsA: How to Fill in the field when the field is empty in PHP?
You can use an if ternary with Empty to check if it came null, it looks like this. 'LIMITE_SUPERIOR' => empty($linha['LIMITE_SUPERIOR']) ? 0 : trim(empty($linha['LIMITE_SUPERIOR'])…
-
1
votes1
answer91
viewsQ: PHP iframe opening more than one session for the same browser
I am working on an Adsense system, and on the same page has several iframes called, the problem is that I need to limit the amount for each page Only because the access is very fast he creates a…