Support the ongoing development of Laravel.io →

4,314 Threads

Self query using Eloqent? Advice needed

Hello, I have my user model referencing a table with a UserID as the PK. The same table has another...

0 Likes
10 Replies
Solved

How to perform this complex SQL request in Laravel

Hi all, I want to perform this complex request in Laravel 4.2 : SELECT i.serial, z.name, count(im.da...

0 Likes
8 Replies
posted 10 years ago

Eloquent joining of multiple tables?

I have three tables: 1. Users Table field: user_id 2. Likes Table field: item_id...

0 Likes
1 Replies

Problem with Eloquent 'orWhere' clause

Hi guys, I'm having difficulties working with the query builder syntax. I'm trying to convert this...

0 Likes
1 Replies
Solved
posted 10 years ago

parse another table after belongsToMany result query (Eloquent Laravel)

I have posted in stackoverflow a question, however I did not get any answer. http://stackoverflow.co...

0 Likes
1 Replies
posted 10 years ago

Many-to-Many and Eager loading query

I am new with Laravel, I was able to query Many-to-Many relationships. Where 'template_dynamic' is t...

0 Likes
1 Replies

Seed did not work but migrate work perfectly

Hi friends, I try to make a modular Laravel application. I use "https://github.com/bstrahija/la...

0 Likes
5 Replies

Need to create a override table function?

Illuminate \ Database \ QueryException SQLSTATE[42S22]: Column not found: 1054 Unknown column 'suppl...

0 Likes
1 Replies
posted 10 years ago

Eloquent custom query on construct

Hi, Is there any ability to perform a custom query on my model's initialisation? The reason is, i wa...

0 Likes
5 Replies

eloquent - set value from sql select query

How can I do the following using eloquent? INSERT INTO table (column) VALUES (select max(id) from ta...

0 Likes
1 Replies
posted 10 years ago

Get index of array(with objects inside) where the object's attribute = x

Hi, I have an array with objects called $buildings It has 5 buildings, each with a relation to a &q...

0 Likes
5 Replies
Solved

Eloquent model events not firing when using relations?

I have a typical event hook for soft deleting children: public static function boot() { parent::boo...

0 Likes
1 Replies

Database design with different users

#Dear people and cats. Do anyone have a smart idea of how to design a user table with different user...

0 Likes
2 Replies

Nested relationships when parent is a many-to-many relationship

Hi, I have these three models: Building (table: buildings) Object (table: objects) BuildingType (tab...

quyle92 liked this thread

1 Likes
21 Replies
Solved
posted 10 years ago

Call to undefined method Model::where() - also effects all(), find()

Hey guys, Something very weird has happened in an application that I am building today. All of a sud...

0 Likes
1 Replies

(Laravel 5) Avoid Repetition in Controllers

Hi, I have 3 controllers that basically List/Create/Edit/Remove things in database (Products, Carts,...

0 Likes
2 Replies
Solved

Float - displaying with extra decimal values

I will try to briefly explain this problem I'm having. I have a database field called "price&qu...

0 Likes
3 Replies
Solved

Mysql silently fails when updating relations using sync()

I am posting arrays of related field ids using the product id as the key, to my controller: $input...

0 Likes
1 Replies
Solved

Advice on crating database properties

Hi guys, This question might be more of a generic database design question, but I'm using it for a L...

0 Likes
2 Replies

laravel 4.2 custom observer event

Hi every body. I have a directory under my app folder named observers and I listen for various event...

0 Likes
1 Replies
Solved

Thanks to our community

Solutions given in the past year. Excluding solutions from thread authors.

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.