Support the ongoing development of Laravel.io →

3,323 Threads

[Conversation] Help me refactoring this class and make it testable

Hi all, I've this lil class that helps me in building a form for a specific case: Invoice Infos http...

0 Likes
1 Replies

Dynamic constraints from router in Eager Loading

Hey guys, i've been looking for example about dynamic constraints using eager loading, but many exam...

0 Likes
0 Replies
posted 10 years ago

Relationship and access to methods in models

Hello guys, How can I access methods of model in relationships? class B extends Eloquent { public...

0 Likes
0 Replies
posted 10 years ago

OrderBy WhereHas

$headlines = Post::whereHas('categories', function($query) { $query->where('name', '=', 'headlin...

0 Likes
3 Replies

Setting Database connection for Many To Many Eloquent relationship

Hi, I'm working on application that requires managing several databases from one administration inte...

0 Likes
1 Replies

Interface/Repository to multiple models

I'm writing a system around an existing database structure using Laravel 4.1. The current system is...

0 Likes
8 Replies
posted 10 years ago

OrderBy with my custom attributes

Hi, I've tried to figure out if this is possible, but can't figure out how if it's even possible. Le...

0 Likes
4 Replies

Loosing relationship when doing ->select(...)

Hi, I have two tables that look something like this: # Author # ID Name Slug 1 Denni...

0 Likes
3 Replies

whereHas() within a where() sub-query.

Howdy! When I try to use a whereHas within a grouped where class, I get an error. Any ideas? $activi...

0 Likes
2 Replies

Trying to query a relation of a relation

##Problem I have an eloquent model "Invoice" that hasMany "InvoiceTicket" that b...

0 Likes
5 Replies

Different types of users

Hello everyone, I'm an absolute beginner to Laravel, and this is my first thread, so I hope I'm not...

0 Likes
3 Replies

Auth, query scopes and whereHas() do not work together

i have set up users and roles table with a pivot table and i need to check, if logged user has admin...

0 Likes
0 Replies

[macro] Form::select() with optgroups based on model's field

Suppose you have a simple products table: id | name | category ....................... 1 | prod1 |...

0 Likes
1 Replies

Create new relationship between two models

Hi, I have two models : Sale.php <?php class Sale extends Eloquent { public function groups() {...

0 Likes
4 Replies

whereHas for polymorphic relations

Hello, I'm trying to load an Eloquent model with a polymorphic relationship. I want to get Photos th...

0 Likes
0 Replies

How to limit records from related tables?

Hi everyone! I'm new to laravel and I need some help with this problem. I have 2 tables posts and po...

0 Likes
4 Replies
posted 10 years ago

Eager Load with Limit / Take()

Hi guys i'm trying to Load all Collection with Items inside Collection with Eager Load but i only wa...

0 Likes
1 Replies

"Prefix" all queries with a where clause

I'm buidling a SaaS and have added a client_id column to each of my tables. Now in my repositories,...

0 Likes
3 Replies

Eloquent: join on confition

Hi, I need to join one table into a query only if another condition is true. I try, using the exanpl...

0 Likes
4 Replies

Fix for "Undefined property: {ModelName}:$attributes" error

The old forums either had no solution for this, OR said the issue was solved by switching to file ca...

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.