Support the ongoing development of Laravel.io →

4,311 Threads

Saving/updating object + relations from json PUT/POST body

Hi, maybe i'm missing something, but i'm having a hard time figuring out how to save/update models w...

0 Likes
1 Replies
posted 10 years ago

Eloquent one-to-many multiple insert

Hi All, I can figure out how to save multiple items with one-to-many :( $order = new Order; $order-...

0 Likes
4 Replies

how do i get the insertID of the inserted product ?

if i do $browsenode->products()->save($product); thanks in advance dudi

0 Likes
1 Replies
Solved

Query Builder Problem (Order by a related Table)

Hi Guys, i have a problem with my table structure and the query builder, as i am not able to build t...

0 Likes
1 Replies
Solved

Artisan Commands -- Eloquent ORM Save Error

Hello, Here is my NewSite.php command file: <?php use Illuminate\Console\Command; use Symfony\Co...

0 Likes
0 Replies
posted 10 years ago

OK to set attributes to collection?

I've been setting custom attributes to collection objects. For example; Looping through $items check...

0 Likes
5 Replies

Why two queries in Relationships, not join ?

When we do a relationship (e.g. One to One): $phone = User::find(1)->phone; there are 2 queries:...

0 Likes
9 Replies
Solved

Pulling Results based off clearance

This one has been picking my brain for a while and I have tried multiple methods but can't seem to m...

0 Likes
0 Replies

How to test a class which depends on an Eloquent model with relationships?

What is the best way to write a unit test for a class which depends on an Eloquent model with relati...

0 Likes
1 Replies

Passing variable to view, not working?

Hey guys, I've got this view, and im passing a variable to it, however it returns an error to me. Th...

0 Likes
21 Replies

Many-to-many, find modelA which belongs to a set of modelB

Sorry if the title is confusing. I am finding it difficult to word this question. Basically I have a...

0 Likes
0 Replies

Comments sorted by upvotes/downvotes

Hi everyone, I'm building a website where every posts has comments. Each comments have upvotes/downv...

0 Likes
0 Replies

Not able to get proper return from sql raw test

I have a postgres function that measures the distance between two points. I want to use this as a te...

0 Likes
1 Replies

Postgres view

Is possible to query a postgres view by declaring oi eloquent class protected $table = 'view_name';...

0 Likes
1 Replies

Using "where" with dynamic properties

I have a situation where a user can upload profile photos to an album: there is a "users"...

0 Likes
2 Replies

email validation never fires.

I'm not 100% sure if this is a bug in Ardent or Laravel, but I cannot seem to get the email validati...

0 Likes
3 Replies
Solved

Having problem inserting multiple rows in a table.

I have got the following array from my form. Now I want to store those data in a table. Array: Array...

0 Likes
2 Replies

MySQL query with curdate() not working

I'm rewriting a site using Laravel and having problems with queries involving dates. This is a pre-L...

0 Likes
3 Replies
Solved

Eager loading with "limit" not working.

I have two tables news and comments. News can have many comments: //News public function comments()...

0 Likes
1 Replies
Solved

Fills created_at and updated_at on record creation

The timestamps are being filled in both the created_at and updated_at when a record is created in my...

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