Support the ongoing development of Laravel.io →

3,323 Threads

How to clean up this code? Dynamically setting property names, eager loading, handling arrays

WARNING: NASTY PROCEDURAL CODE AHEAD. Let's say I have an ajaxified to-do list app. I have this rout...

0 Likes
0 Replies

[Tutorial] Model Validation using Observers

Hi guys, I have recently posted a new tutorial on something that seems to have been missed by the La...

0 Likes
2 Replies

Ho boy - I have a very large query with > 10 joins - is there a way I can do it with Eloquent?

I've been searching and hacking away for the past few hours now. I have a bunch of models. They're...

0 Likes
0 Replies

Is it possible to call directly from a class.

Hi all, I'm still chipping away at learning Laravel. Coming along slowly though. :-/ In my db class...

0 Likes
2 Replies

Eloquent nested eager loading : bug or fail syntax ?

Hi all :), First of all : I opened a help paste here describing the core of the problem. I did many...

0 Likes
0 Replies

Best practices or better way to achieve these relationships

I'm developing an application system. Breakdown is there are Events and Districts - the Application...

0 Likes
0 Replies
posted 10 years ago

->contains() with morphToMany

Trying to do this, but the "contains" method doesn't work... anyone know why, or how I sho...

0 Likes
1 Replies

select user followed person's post

users id follows id user_id follow_id posts id user_id let say i am user A and i followed user B. I...

0 Likes
0 Replies

How to properly design interchangeable user repository implementation?

I want the repository to be interchangeable, so I'm not dependant on Eloquent. I therefore have an i...

0 Likes
0 Replies

Any easier way to do this? Can you extend a model that's a conditional of the parent model?

Check out my code here: http://laravel.io/bin/9n9 I have a working solution now as shown, but I'd li...

0 Likes
0 Replies

Eloquent relationships remember()

Is it possible to cache relationships with the remember function? $screen->Texts()->with('Tex...

0 Likes
2 Replies

Advanced leftJoin with date functions

Hi, I have https://gist.github.com/RokSiEu/8793452 But I need to get https://gist.github.com/RokSiEu...

0 Likes
1 Replies

Doctor Channeling System

Hi, So we have a new project that will be used by multiple hospitals to have web-based doctor channe...

0 Likes
0 Replies

Derived table from Pivot table

Hi folks, i have an issue about a derived table from a pivot table. Here is my schema: locale id nam...

0 Likes
4 Replies
posted 10 years ago

Polymorphic Relationship with Self referencing

I've created a user relationship similar to that of twitter. This is a self referencing many-to-many...

0 Likes
0 Replies

Forget cache on touch

Hey, I want to cache my queries like getting all projects assigned to a user. I use ->remember(36...

0 Likes
3 Replies

Chaining first()

I just started using laravel, and I am trying some code. $candidate1 = ot_Candidate::where('id', '='...

0 Likes
1 Replies
posted 10 years ago

Error handling design advice

Right now, when I do something to the database that could fail... such as add a new record where the...

0 Likes
3 Replies

Failed PDOException

Can someone tell me how this code fails even though I am catching the PDOException? https://gist.git...

0 Likes
1 Replies

Help with proper query

I am looking for help in grabbing data the proper Laravel way. An existing site is being converted t...

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