My question is this: I want to organize my json so that I can see the Animal and Farm table, but organized, for example:
{
"animais": {
"id": 1,
"nome": "Mimosa",
"data_nascimento": "2017-04-11 00:00:00",
"codigo_bri...
Internally everyone is working, migrations , tinker , sqlite3 , but in the server application it always queries mysql instead of sqlite for all operations, ie it is using Connector.php instead of% with%...
My problem is as follows ....
I have a route that receives the year and month to get some information in the bank.
When the month does not come I need to make the sum of all the months of the requested year.
if($month == 0){
$dbRegis...
I have a $table->enum('situacao', ['ativo', 'exonerado']); field.
I created a checkbox to do the registration, but it returns the following error:
1048 Column 'situation' can not be null.
How can I resolve?
The checkb...
I'm creating a system and I have two columns: empresas and usuarios . The usuarios.id_empresa does is the foreign key of empresas.id_empresa , however, some data of the two tables are filled in simultaneously and after...
I'm using Laravel for an API
In my DB I have a table called tbmanifestacao and in this table I have a column called nrmanifestacao
I would like my controller to return the highest nrmanifestacao
I tried this way:...
I have the following tables, Condominios and CondominiosTaxas , which are a 1:N relationship, respectively, my relationship in the Condominium model:
public function Taxas()
{
return $this->hasMany('WebCondom\Models\...
Developing an API that must handle a high-performance website. By doing a few tests, I noticed that Eloquent usage is lowering the performance of requests in the MySQL database in 51.39% (more than half). The OS is ubuntu 16.04 and the fra...
There are 2 tables and a pivot where it makes the ManyToMany relationship between 2 tables .
A table is called Postagems and the other table is named Departamentos , so I'm trying to do a related search by depart...
I have the following relationship on a test system I'm doing.
:: MODEL EMPLOYEE
public function users(){
return $this->hasMany('lbo\User');
}
:: MODEL USER
public function employees(){
return $this->belongsTo('lbo\Employe...