I'm getting a result via Request in Laravel like this: "2.1", I need to remove the double quotation marks from the result, because when I enter as a parameter in the query the whereIn understands as string ao instead...
I have the following query:
SELECT P.ID
,P.NR_CRACHA CRACHA
,P.NM_CLIENTE NOME
,E.DS_EMPRESA EMPRESA
,SUM( R.VL_PRECO ) VALOR
FROM registro R
JOIN pessoa P
JOIN empresa E
WHERE P.CD_PESSO...
I have the following Tabelas/Models and I am not able to make a query:
Model 1
id | Name
---+---------------
1 | Model1.1
2 | Model1.2
3 | Model1.3
Model 2
id | Name | model1_id
---+----------+----------
1 | Mode...
I have several 4 tables Starting with Users - > Departments - > category_department - > category - > postings;
Where the department_category table it serves as pivo for many to many relationship between the departments table and the...
I have a situation as follows. I have 4 tables users - > department - > category_department - > category - > postings
Where in my view I have a select where it shows a data relation about ex department:
Thisinformationalreadycome...
I'm having trouble saving the foreign key in the database. I'm working PHP , Laravel 5.3 and MySQL , below goes the code:
Product Controller
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Produtos...
As you can see in the controller , I am listing the information for each agreement, along with information that is in other tables (phones, address ), to list the specialty and type of service of each.
Unlike the phones and address tabl...
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class Sale extends Model
{
protected $guarded = ['id'];
public function vendor()
{
return $this->hasMany('App\Vendor');
}
public functi...
I wonder if it is possible to retrieve the ID of a template at the time it is saved to the database. I'm using the following Eloquent method:
$modelo = Modelo::create(['ATT1' => 'valor1', 'ATT2'=>'valor2']);
The template is saved, but...
I am doing some exercises, but there is one where I can not understand why it is not working when I make another name in the method. I have a method in Model Location , where it does relationships of OneToOne .
When I cal...