Support the ongoing development of Laravel.io →

4,311 Threads

How to setup a polymorphic relationship?

Hi guys! I have a posts table and a post may have one media. It can be a video or a gallery. This is...

0 Likes
0 Replies

boolean TRUE/FALSE not saving in DB

Hi, I have a boolean column in table. I have also added that field in $fillable in modal class. When...

0 Likes
0 Replies

Table data as form input when editing a resource

I was wondering if there is any good way to treat table data as form input data. That's probably cle...

0 Likes
0 Replies
posted 10 years ago

Filter laravel collection

Hi folks, I'm having problems with filtering related objects: 2 Tables: customers and bills A custom...

0 Likes
2 Replies

How to override the Model that morphTo will create?

Hi guys! I have a posts table having these fields id content post_type media_id postable_type The...

0 Likes
0 Replies

Migrate How to Change Column by One Setp

I want change password column length 32 to 60 Why this is not work, if (Schema::hasColumn('users', '...

0 Likes
0 Replies
posted 10 years ago

deleting with associations

Hi all, I have a User model that hasMany Assessments so: class User...{ public function assessment()...

0 Likes
2 Replies

Models properties

How do i make eloquent: NOT assume that my primary key is only named 'id' set the $timestamps prope...

0 Likes
8 Replies
Solved

Database whereHas with Wherein (Query Builder)

id item_id tag_id 244 25090 28 247 25091 28 249 25091 33 250 25092 28 251 25092 33 253...

0 Likes
1 Replies

Capture Model old data before committing updated data to database

Hi, We have a requirement in our application wherein we need to capture all instance of update opera...

0 Likes
1 Replies

Array on One Column (Join)

DB::table('users') ->join('contacts', 'users.id', '=', 'contacts.user_id') ->join('orders', 'u...

0 Likes
1 Replies

getting id from a join

i have this join statement : Item::join('buttons', 'items.cta_id','=','buttons.id')->where('build...

0 Likes
2 Replies
Solved

Getting Call to undefined method, while pulling records from a model.

I must be missing something obvious here... I have a model called PlanType and another called Pricin...

0 Likes
2 Replies
Solved
posted 10 years ago

Manager/User relationship

Hi, I have set up my site so that a User can have a Role by doing: class User... public function...

0 Likes
1 Replies
posted 10 years ago

Getting orderby in conversation

How do I achieve to order my conversation by latest messages. I got this so far but it's not working...

0 Likes
1 Replies

Opinion on getReceiver

Would you do // Model public function getReceiver() { return $this->users()->where('user_i...

0 Likes
0 Replies

Baum Nested Set Retrieve all tree with relation

Hi, I have Category model based on Baum Nested Set (https://github.com/etrepat/baum) package and Cat...

0 Likes
2 Replies
Solved
posted 10 years ago

Will a touched object have the same timestamps as the toucher?

I have a similar example to that in the docs.. a comment and post scenario. I want notifications whe...

0 Likes
0 Replies

Laravel Validate Many-To-Many Relationship

So I have this Offer model with several offers available. I also have a Pattern model that has a man...

0 Likes
0 Replies

Laravel import thousand of records from csv file?

I have a csv file with thousand of records. How can I use Eloquent model to import all data?

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