Support the ongoing development of Laravel.io →

4,312 Threads

Issues with Eloquent using with(), groupBy() and sum()

I have got my relationships correctly set in the models. I like that I do not have to join any table...

0 Likes
0 Replies
posted 7 years ago

Return json object instead of array

When i return json, it returns a array instead of an object. $order = Order::where('user_id', $custo...

0 Likes
0 Replies

Add New Element to Item in the Collection

So I am trying to add new item to a collection. So how i do I add it? My Code $users = User::where...

0 Likes
2 Replies

take previous value in Laravel Excel

Hi guys! I'm currently trying to implement something like this but with laravel- Excel: link Excel:...

0 Likes
1 Replies
Solved

Database relationships one-to-one not saving

I'm a noob at this, please forgive me but I'm trying to connect a one-to-one relationship between a...

0 Likes
0 Replies
posted 7 years ago

Removing 'the', 'an' and converting numbers to text

I'm trying to use a sort field in my database but everything needs to be entered twice. So I'm looki...

0 Likes
0 Replies

Fetching JSON data from API

I'm trying to fetch JSON data from an API and it's returning null. Here is my code: $movie_url = '...

0 Likes
0 Replies

Combining results of queries

I am trying to combine results of two queries: For my first query, dd($sales) array:3 [▼ 0...

0 Likes
0 Replies

Call to a member function groupBy on a non-object

I am trying to merge two queries $sales = DB::table('sales') ->join('drugs', 'drugs.id', '=',...

0 Likes
2 Replies

Help me please translate simple raw update query eloquently

Hey guys, Been trying to come with solution to translate this query as eloquent as possible, but kee...

0 Likes
1 Replies
posted 7 years ago

Relationships are correct but returns null

Been on this for many days now but I can't seem to figure it out <?php namespace App; use Illum...

0 Likes
0 Replies

Mass Insertion of Dummy Records w/Relations

I am trying to insert 1000's of dummy records over numerous seeding artisan commands. But I am stuck...

0 Likes
1 Replies

Trying to get property of non-object One to one relationship eloquent (URGENT)

i have two tables books and 'books_photos' table . Which has one to one relationship. <?php...

0 Likes
6 Replies

accessing price sum on the basis of subcategory

I have three tables: Item { id, category_id, name, price} Category { id, subcategory_id, name } Subc...

0 Likes
0 Replies

How to query soft deleted models?

I have a social network type site where there is the normal front end and an admin interface for me...

0 Likes
0 Replies
posted 7 years ago

How to display the image of pictures in a relational Table.

I have two tables: books and photos table. I stored all the information of books in the books table...

0 Likes
0 Replies
posted 10 years ago

Model to array / Model to json Not working

Hello,.. I am new in laravel, and I have a problem when going to transform the model into an array....

0 Likes
4 Replies
Solved

Infinite scroll on a table [L5]

Hello, a few months ago, I successfully implemented Infinite Scroll in Laravel 5 using this tutorial...

0 Likes
3 Replies
Solved

Eloquent / Fluent SubQuery select

Hi, I can't find a way to do a left join to count elements from pivot table using Eloquent and Fluen...

0 Likes
3 Replies

Insert Mass Dummy Records

I want to create 1000's of dummy users, but also correct relations. Example would be create a User w...

0 Likes
0 Replies

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.