Support the ongoing development of Laravel.io →

4,608 Threads

Single model used various times in a relation

Hi, so I have a question regarding relationships. I have a user model, and an event model. The event...

0 Likes
2 Replies
posted 10 years ago

Querying database for stats table

I am working on creating a page with stats from data in a MySQL database, and trying to figure out t...

0 Likes
0 Replies

Wrong decimal places for float and decimal

I have a great problem with Laravel at the moment. I've tried float and decimal datatypes without an...

0 Likes
3 Replies
Solved

Please help with syntax problem in migration/Schema code

I have the following code that produces the following error: "Undefined variable: tbl" The...

0 Likes
2 Replies
Solved

OneToMany relation -> How to save when i have the id?

I have model called Reference which can have many child References but only one parent Reference. So...

0 Likes
3 Replies
posted 10 years ago

Database access in Laravel 5

On using the DB inside the controller I am getting an FatalErrorException stating class 'App/Http/Co...

0 Likes
4 Replies

Insert data from a relation using Eloquent

Hello All, Im new here and just would like to know if the below way is PROPER OR NOT(it works for me...

0 Likes
2 Replies
posted 10 years ago

SQL Statements to Eloquent

hi i want convert this sql to eloquent but i don't now SELECT companies.LVal18AFC, basket.qty, b...

0 Likes
2 Replies

Search and filtering with whereHas

I have 3 tables. Photo id area_id user_id description User id name Area id name I want to make a...

0 Likes
6 Replies

Laravel 4.2, Flysystem and Amazon S3 public file URL

I am uploading my images to S3 using Flysystem. In my database I keep only the file name (image.jpg)...

0 Likes
0 Replies

How to use this query in laravel

I'm converting roject from pure PHP to Laravel 4, and I have a problem with converting this query SE...

0 Likes
3 Replies
Solved

Form/Model binding not working

I'm in the process of getting to grips with L4 and I'm having issues with saving/retrieving/updating...

0 Likes
4 Replies
posted 10 years ago

firstOrCreate giving a foreign key constraint error

Hi, Having a problem with using firstOrCreate with my Eloquent model $progress = Progress::firstOrCr...

0 Likes
2 Replies
Solved

I don't know filters on Collections

Hi, guys. I have 2 connections to databases with this configuration: /app/config/database.php 'princ...

0 Likes
0 Replies

Is there a difference in Eloquent between hasOne & belongsTo when both keys are given?

If I fully specify the keys, is there a difference between hasOne and belongsTo relationships? Or if...

0 Likes
0 Replies

delete/alter data in model relationships

Hi, If I have something like this: $user = User::with('phones')->find(1); It gives me the user's...

0 Likes
1 Replies

Aggregate, Aggregate Roots and Repositories managent with Laravel

Hi, I was working with some Entities that may contain some other dependent Entities or Value Objects...

0 Likes
0 Replies

Eloquent hasManyThrough relation and with a little customization.

Parent, Child and Tag are three models. Parent (id, other fileds ....) Child (id, parent_id, tag_id...

0 Likes
1 Replies
posted 10 years ago

How to use Many 2 Many and a custom date?

Hey guys, When i use my model for Year, i can get all articles that are connected with the year tabl...

0 Likes
2 Replies

find($id) and whereId($id)

What is the diference between find($id) and whereId($id)?

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.

© 2025 Laravel.io - All rights reserved.