Support the ongoing development of Laravel.io →

4,301 Threads

Getting 'undefined method error for orderBy()' on new repository

With the help of some nice folks over on Reddit I was able to get most of my controller functionalit...

0 Likes
1 Replies

Is it possible to set properties to the authenticated user?

In the User model, I've created a property called groupMembership and a method called setGroupMember...

0 Likes
3 Replies

Adding Select statement to ORM

Retrieving A Record By Primary Key $user = User::find(1); var_dump($user->name); Is there anyway...

0 Likes
4 Replies
Solved
posted 10 years ago

Retrieve the sender username of a message with relationships

In my Message.php model, I defined the following: class Message extends Eloquent { public functi...

0 Likes
3 Replies
Solved

Relation with dynamic entity

Hello guys, I got this big question on this scenario: I'm building a easy post and comment system, b...

0 Likes
2 Replies

Related table, possible issue with table name?

Hi, I have a simple scenario here that is bugging me. There are two models: class DbNation extends E...

0 Likes
3 Replies
Solved
posted 10 years ago

getDateAttribute() is swapping year and day around when Saving to the Database

Retrieving a datetime field which is YYYY-MM-DD and I need to display it as dd/mm/yy. So I am using...

0 Likes
4 Replies

A bunch of questions about the "right" way - DI, IoC, Repo pattern

Some background: I've been working with L4 for about 6 months doing things the "pretty" wa...

0 Likes
1 Replies

[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

Accessing Model and Controller from custom library class

I'm trying to access a Model and Controller from a custom library class. I have created an app/lib f...

0 Likes
2 Replies
Solved

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

Setting transient properties on Eloquent models without saving to database?

Is there a way to set a transient property for an Eloquent model that won't save to the database? Fo...

0 Likes
3 Replies
Solved

Eloquent query based on (multiple) route params

I have a route like this: www.mysite.com/agenda/2014/08/16?tags=entertainement,sport,information&...

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

© 2024 Laravel.io - All rights reserved.