Support the ongoing development of Laravel.io →

4,300 Threads

Joined table IDs are returned in the Model Collection instead of the main table IDs

Hi Guys, I have a query which it's toSql result is: select * from `jobs` left join `locations` on `j...

0 Likes
8 Replies
posted 10 years ago

I doing somthing wrong? the sentry save update does not update DB but returns true

Hi i was checking my develop and i saw something wrong, the develop works apparently fine but just w...

0 Likes
2 Replies

Eager Loading and Relations.[URGENT]

I'm trying to relate a user model and a comments model. My user model has the following code.. clas...

0 Likes
4 Replies
Solved

Seeding from migration

This may be a weird question, but is there a way to seed the db from a migration? The reason is that...

0 Likes
1 Replies
Solved

Increment in Query Builder

DB::table('items')->where('id', $itemID)->increment('save',1); As above, is that possible or d...

0 Likes
1 Replies
Solved

best way to save a model with it's relasion

I have two tables products (model: Products) product_common_auction (model: ProductCommonAuction...

0 Likes
0 Replies

Model::find($id) is being called 2 times to get related records

I am running the below Controller method which gets data from a specific Campaign table by campaign_...

0 Likes
2 Replies
posted 10 years ago

eloquent lists 2d array

table data id name type 1 Plain PATTERN 2 Strip PATTERN 3 Checker PATTERN 7 Oxford FABRIC 8 Twill FA...

0 Likes
1 Replies

"Different" validation approach

Hello Artisans! I'm working on a project that is quite complex and I'm trying to find the best solut...

0 Likes
3 Replies

Relationships (One-to-One)

I'm new to Laravel put like what I see so far. Here's my issue. In my example app I have 2 models...

0 Likes
10 Replies
Solved
posted 10 years ago

How to add user id as a default value when inserting new records

I am building app for enterprise their are three tables: users table (belong to company) companies...

0 Likes
5 Replies

Querying a Many-to-Many Relationship

I might be overlooking this in the docs (Laravel 4.0) but I need to know how to query a many-to-many...

0 Likes
3 Replies

Laravel using wrong table name?

Here's my Level model: class Level extends Eloquent { protected $table = "levels"; }...

0 Likes
4 Replies
Solved

Non-static method Confirm::posts() should not be called statically, assuming $this from incompatible context

These are my models User public function posts() { return $this->hasMany('Post'); } P...

0 Likes
5 Replies
Solved

Combining two query (WhereIn with Where) x 2

$userCollection = DB::table('collections') ->whereIn('user_id', array())...

0 Likes
3 Replies
Solved

Cannot find records using ->where() and booleans

Hi, I'm having a problem. Using migrations I create the following field: $table->boolean('is_clos...

0 Likes
1 Replies
Solved

multiple queries in a scope function

HI I have recently posted this questions on stack overflow. I was hoping someone here would know the...

0 Likes
0 Replies

Issues with Eager Load With Limit & Variable

The following would give me collection without Items. $collectionList = Collection::where('user_id',...

0 Likes
7 Replies
Solved
posted 10 years ago

Extending Eloquent Builder parseRelations

Has anyone thought of extending this method? For example I have a couple of models with the followin...

0 Likes
0 Replies

Visible, Hidden, Fillable & Guarded with Foreign Keys

Hi, First question: What options should foreign keys use? Guarded? I have an Article object that has...

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