Support the ongoing development of Laravel.io →

4,311 Threads

How to create a relationship that joins on two (multiple) non-standard columns.

I've seen this question asked slightly differently several times in other threads. But the problem I...

0 Likes
0 Replies

Laravel equivalent .try() method in Ruby

Earlier today I asked on the chat room about php/laravel's equivalent of .try() in ruby - http://api...

0 Likes
2 Replies

Before find hook

Hi! I am creating a second project for a company. The first one was written by me in Yii framework....

0 Likes
5 Replies

Query builder vs Eloquent builder relations and `load(relation)` issues

My question is summed up nicely in this bin- This is my first attempt at a 'search builder' function...

0 Likes
1 Replies
posted 9 years ago

Sorting eager loaded results

I'm having this problem with multiple methods in multiple controllers. Here is my method: $original...

0 Likes
5 Replies

Many-to-Many returns NULL

I have no issues writing to my pivot table, but returning associations returns null Schema: $table-...

0 Likes
0 Replies
posted 9 years ago

Model::create() doesnt return a ID

Hey guys, How can i get the ID of my saved model? I dont use save(). I use create(). $page = new...

0 Likes
2 Replies

XML 2 MySQL Solution

Hi everyone! I have been searching for a solution to import XML to a MySQL database without knowing...

0 Likes
1 Replies

Count and Max in a same query

Hi! I'm trying to execute a complex query with Eloquent. So, I have a model "User" which...

0 Likes
7 Replies

Duplicated hasmany relation or not showing at all?!

Alright so I have a ticket with many ticket replies public function show($id){ $ticket = Ticket::fi...

0 Likes
1 Replies
Solved
posted 9 years ago

Eloquent confused about which id column to use when using a join with eager loading

I have the following query that's supposed to eager load data from the 'features' and 'images' table...

0 Likes
1 Replies
Solved
posted 9 years ago

Creating relationship with keys not in integer

I meet a problem when making eloquent. Now I have two tables in my database, say "Users" a...

0 Likes
2 Replies
Solved

Parent item in same table join ?

Hello ! I have a table that contains Pages with columns (ID,Title,Parent_id) page can be root(Parent...

0 Likes
0 Replies

IF statement in query on Laravel 3, possible?

Hi all, For a project running Larvavel 3, I need to modify an existing query using an if statement,...

0 Likes
0 Replies

Eloquent relation with where condition on model attribute

I have two models Student and StudentRevision with Student model having hasMany relation with Studen...

0 Likes
1 Replies

counter for email

Is there a way to count email that has been send to the address of the website

0 Likes
6 Replies

Case sensitivity

Can someone confirm that this is intended behaviour? In a model Text I have this relationship: publi...

0 Likes
1 Replies
posted 9 years ago

Creating a dynamic model relationship

0 down vote favorite I have three models User.php, Profile.php, CorporateProfile.php and trying to c...

0 Likes
1 Replies

Object of class Illuminate\Database\Eloquent\Builder could not be converted to string

Whenever i try to use a query scope it my model it returns the following error: Object of class Illu...

0 Likes
2 Replies

Advanced Joins with Join Where statements messing up Query Parameters

Hey everyone. Currently I am doing quite a crazy query which needs to do multiple joins but also nee...

0 Likes
0 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.

© 2024 Laravel.io - All rights reserved.