Support the ongoing development of Laravel.io →

4,314 Threads

Limit output data in eloquent query

Hi! I have two models, for example User (name, email) and Address (user_id, address, zip); If I call...

0 Likes
0 Replies

Where conditions on eloquent relationship

I have two tables auctions and bids and models for them are as follows public function bid() { retu...

0 Likes
2 Replies

Call to a member function delete() on null

I keep getting the error "Call to a member function delete() on null" for the following, w...

0 Likes
0 Replies

Two-Sided Eloquent Relation?

Hello, in my application users can add other users (to establish a "friendship"). Therefor...

0 Likes
0 Replies

Eloquent Relationships related question

Hi laravel community, I am a new laravel user and currently working on a simple project management t...

0 Likes
3 Replies

L [5] : Use Eloquent model Globally without using namespace

I want the Eloquent model in app ->Models ->users.php and in every file i h...

0 Likes
4 Replies

Foreign key insertion problem in qualification table using laravel 4.2

// qualification.php model <?php class Qualification extends \Eloquent { protected $fillable...

0 Likes
1 Replies

Looping through collection

I am filtering a collection by date of orders with the following in each: {"id":57,"...

0 Likes
4 Replies
Solved
posted 11 years ago

Eloquent Single Table Inheritance

What is Single Table Inheritance? I saw a post by Kapil Verma where he shared his STI base class. I...

0 Likes
8 Replies
posted 10 years ago

Laravel 5 Belongs To Many Problems

So I'm building out a multi-relational database structure, and I'm attempting to retrieve nested chi...

0 Likes
4 Replies

Insert/Update/Delete on Lookup table from Dynamic Array?

Hi, I was wondering what the best way to do this with Eloquent would be? Say for instance I have a &...

0 Likes
6 Replies
Solved

Foreign key, link not working

hi, I have the following schema: Schema::create( 'teams', function (Blueprint $table) {...

0 Likes
2 Replies

Eager load one record from a many to many relation

Hi I'm having a struggle trying to return a single record from a many to many relationship. So in my...

0 Likes
0 Replies

morphMany returning NULL

I'm having a problem with polymorphic relationship. I have the following classes: BankAccount.php...

0 Likes
14 Replies
Solved

Is this right way to do READ UNCOMMITTED?

Is this right way to do READ UNCOMMITTED? $cars = Cars::raw('SET SESSION TRANSACTION ISOLATION LEVEL...

0 Likes
2 Replies

Getting all records from a collection

Hi, Ok,so I am setting up a relationship between my users and roles table, everything went fine unti...

0 Likes
2 Replies
Solved

One to many relationship returning NULL

Hey, I'm having an issue I've been trying to figure out for the last few hours, but I can't seem to...

0 Likes
8 Replies
Solved

Select time from base as UNIX_TIMESTAMP(time)

Hello, I have in base field with type datetime, it's time field. I want to get all elements from bas...

0 Likes
1 Replies

Will Model Relationships work with No Table relations in database

Hi Guys, I have a database that predates me and it has no relationships define in the database itsel...

0 Likes
2 Replies
Solved

Eloquent timestamps - use only created_at

I have a problem with a model, I only have created_at field and I added getDates() method which retu...

0 Likes
2 Replies

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.