Questions tagged as 'laravel'

1
answer

Initial Value Sequences Postgresql - Laravel 5.1

Hello, I'm running some tests in my application, but I'm having the following problem: After migrate and db:seed , whenever I'm going to insert some registry by applying a duplicate primary key error. I have already seen that this e...
asked by 11.01.2016 / 13:43
1
answer

Ambiguous column - Laravel 5.1

Good morning! It's the following ... I have these 2 tables in my postgresql database: tipos_risco --id --nome agentes_risco --id --nome --id_tipo_risco (foreign key) The problem is that I am not able to extract the data from them together,...
asked by 06.01.2016 / 13:50
2
answers

How to do integrity validation when trying to save duplicate data to the database?

Context: When attempting to register the Structure Checklist object, the following error occurred: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '6-5' for key 'un_checklist_estrutura' (SQL: insert into che...
asked by 28.08.2018 / 16:59
1
answer

Error changing server hosting - Laravel PHP

When switching hosting servers, the application has the following error.        
asked by 15.10.2018 / 15:48
1
answer

When using back () in laravel this should be preceded by redirect ()?

Looking at a lot of implementations I've seen that people use a certain frequency return redirect()->back() ... My question is: What is the difference between return redirect()->back() ... and return back() ...    ...
asked by 04.04.2018 / 00:41
1
answer

Ajax crashes the computer

Review the code below function update(){ $.ajax({ url : 'http://localhost/sistema', type : 'get', dataType : 'json', success : function( data ){ console.log('Mostrar dados: '+.data.dado); } }) } setInterval(fun...
asked by 24.04.2018 / 16:07
1
answer

Query table row by column name in Laravel?

In Laravel I want to query a record in the database for id of the table, but the code below only queries if the column nomenclature is id $prod = $this->produto->find(3) If the column name is prod_id for example,...
asked by 20.07.2017 / 22:38
1
answer

Can a Repository extend a Model?

If the Repository extends to Model User, am I breaking some of the principles of S.O.L.I.D? I've seen some tutorials talk, that I have to create an abstract class with the same methods as Eloquent, does not that apply to KISS principles? A...
asked by 07.06.2017 / 21:00
1
answer

Select model methods in the Laravel controller index method?

I have an index method that fetches all events in the database and shows them in a table Model Event: namespace App\Models; use Illuminate\Database\Eloquent\Model; class Event extends Model { protected $fillable = [ 'ti...
asked by 14.08.2017 / 00:10
1
answer

How to do sorting by two parameters with Laravel 5.4?

I am doing a descending order to list winners, however it is based on note. My search is as follows: public function getHistorico($id_avaliacao) { return $this->where('avaliacao_id', $id_avaliacao) ->orderBy('nota', 'des...
asked by 23.02.2017 / 14:30