Support the ongoing development of Laravel.io →

4,312 Threads

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

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
posted 10 years ago

Model 'Request' is not loaded

Hey guys. I just began to work with laravel. Sorry for bad English. So I've got a table named 'reque...

0 Likes
3 Replies
Solved

A question on the creation of Models regarding Many-To-Many relationships

Let's say, I have the following strong entities (and their attributes): Post (title, content) Tag...

0 Likes
5 Replies
Solved

Using Variable in DB function

DB::table('users') ->join('contacts', function($join) { $join->o...

0 Likes
2 Replies
Solved

[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

About MVC in Laravel

Hello there, i'm new in laravel, also in MVC development and i want to ask for suggestion about the...

0 Likes
3 Replies
Solved

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

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.