Hi, I'm new to eloquent and laravel, I have the following query, which runs perfectly from phpmyadmin:
SELECT * FROM vips_categories JOIN vips_products JOIN vip_archivos WHERE vips_categories.parent_id = 1 AND vips_categories.parent_id = vips...
Laravel's version is 5.4
Here I put the link of the project to download (Includes database to import, this in App / filtros_laravel.sql)
link
I will give a description of the problem. Let's start with the tables first.
create table cl...
I'm trying to create a field relationship using eloquent de laravel, I currently have it working like this:
$empleos = Empleos::latest()->paginate(50);
return $empleos;
I return all jobs correctly, my problem is that there are fields tha...
I hope you're all right, I have the following query on my system.
public function visits()
{
foreach ($this->countrys as $country)
{
$query = Visit::where('country',$country)->count();
$visits[$country]=$quer...
How can I make this query in Eloquent?
select count(id) as NumeroPreguntas, user_id
from preguntas
group by user_id
order by NumeroPreguntas
DESC Limit 10;
I tried
pregunta::groupBy('categoria_id')->get()...
hello I have two models Movement and Account
In the Movement model I have the following relationship.
public function cuenta()
{
return $this->hasOne(Cuenta::class);
}
What I am looking for is to bring all the Movements with their...
How can I use where to filter in queries with that relate multiple tables.
$a = App\A::with(['bs', 'bs.cs', 'bs.cs.ds'])->get();
how can I make 'bs.cs.ds' attributeX = 40 and 'bs.cs' attributeY = true
How can I pass the following query in Laravel 5.4
SELECT CONCAT(
TRIM(SUBSTRING(NombreCliente,1,1)),
TRIM(SUBSTRING(NombreCliente, locate( ' ',NombreCliente), 2) )
)INICIALES FROM 'cliente'
I have the following SQL query to get grouped and ordered by months the sum of prices of three products, which makes no problem
SELECT name, SUM(precio) AS total, mes
FROM productos
GROUP BY mes
ORDER BY mes DESC;
The result I get is...
my problem is the following I do not manage to capture the id to perform the update function I get the following error: undefined index: id this is the code:
public function getUpdate() {
$id = $_GET['id'];
$blogPosts = BlogPost::find(...