Support the ongoing development of Laravel.io →

988 Threads

Order by pivot table attribute in Eloquent

Hi Guys I have this query: $user = Auth::user(); $user->jobs()->get(); where jobs is a bel...

0 Likes
6 Replies
Solved
posted 8 years ago

Ordering a collection by the related items

My domain model looks like this: Person id first_name last_name other fields Position person_id c...

0 Likes
2 Replies
Solved

Issues with belongsToMany() only returning data for one column on pivot table.

So I'm kind of following the Laracasts Many To Many tutorial in Laravel5 Fundamentals and have the M...

0 Likes
2 Replies
Solved
posted 7 years ago

belongsTo() throwing "Trying to get property of non-object in View: "

I have only a single model with a self join class OfficeType extends Model { protected $table =...

0 Likes
2 Replies
Solved

Add Columns with Methods Undefined

What I am trying to do is set a column to be a foreign key. Following the documentation, it's prett...

0 Likes
3 Replies
Solved

How to get data from one to many relation.

Hello everyone. I have a small problem. I got two models: User and Group. They are connected by one...

0 Likes
4 Replies
Solved

Struggling Where to Put Domain Logic

Hey all, I've been leaning a lot about design patterns and the IoC in the past couple of weeks, and...

0 Likes
11 Replies
Solved

"with" or "load" causes all objects loaded

Hello All, This is my first post on this forum, so I'd like to send warm hello and thank You in adva...

0 Likes
5 Replies
Solved

How Do I Cache Using Eloquent Models?

Hi! I'm new to Laravel, and I have a problem with caching rows using Eloquent. I'm currently retriev...

0 Likes
1 Replies
Solved

Query items that have all categories

Hi, I have a Shops model associated to services, using a pivot table: public function services() {...

0 Likes
1 Replies
Solved
posted 7 years ago

Creating unique id when creating model

Hi, I would like to generate a unique code whenever a new object of a model is created. Therefore, I...

0 Likes
2 Replies
Solved

Laravel Table Filter

So I have website based on Laravel framework. I have table and the filter for table to filter the it...

0 Likes
1 Replies
Solved

Advanced Eloquent query from morphToMany question

I have an Eloquent query question of approach. A Story hasMany Chapter. Story and Chapter are Taggab...

0 Likes
1 Replies
Solved

Custom validateCredentials logic

Hi there, I'm quite new in Laravel since I've started learning it a couple of months ago. I managed...

0 Likes
5 Replies
Solved

Fetching large numbers of rows

Hello guys, is there any way currently to fetch large datasets with Laravel? I know there's chunk()...

0 Likes
10 Replies
Solved

Route Model Binding Return null.

Can Anyone help me with this issue? I'm new to laravel and would like to know how to resolve this. F...

0 Likes
1 Replies
Solved

Laravel 5 - pagination query string after slash issue

Hey guys! I have a problem with my Laravel 5 pagination. I use elequent to fetch user + his items wh...

0 Likes
15 Replies
Solved

Don't sort Array before find()

I want to do an find([3,5,23]) on a model. But it seems laravel everytime is sorting the array befor...

0 Likes
1 Replies
Solved

seeding / accessing one-to-many-relationship

I have a problem with seeding a belongsTo-relationship. My code is the following: // the Model Compo...

0 Likes
1 Replies
Solved

Join multiple tables Eloquent

I am trying to Join multiple tables and get results I have now 2 tables 1- projects_info (id - pro_t...

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