Support the ongoing development of Laravel.io →

4,314 Threads

Query builder returns a Collection when empty and an array when it's not

How can I validate it? If I use: $res = DB::table('estacaohs') ->whereRaw($sql) -...

0 Likes
1 Replies

Result of query into view with foreach

hi all, i have this query: $marche = DB::table('articolo') ->join('marca', 'articolo.id_marca',...

0 Likes
1 Replies

Count the unique (in terms of two columns) records

Hello, community. Can anybody help me with the count query? I have the pivot table with two fields →...

0 Likes
0 Replies

mutator $this->attributes return 'Undefined index: id'

I'm trying to add an attribute to a model but can't access the model attributes when I call it. Deta...

0 Likes
1 Replies

2012-07-09T19:22:09.1440844Z to Timestamp

I saw this format of datetime on a Json file recently. Having issues to convert this into a timestam...

0 Likes
1 Replies
posted 9 years ago

GroupBy date then by another column within date

I'm building a site that has fixtures that are grouped by date, this bit works fine. But I want to b...

0 Likes
0 Replies

Eager load, get all results

Hi guys. I have model 'Element'. Each element have some params (Param model). So there is relationsh...

0 Likes
0 Replies

SQL Query navigating 3 tables in Eloquent

HI, I am new to Laravel and was hoping someone could help. I have 3 tables, SupplierPO, Orders and C...

0 Likes
3 Replies
Solved
posted 9 years ago

Chuck() Dies

Hey guys When all() is exhausted it says to use chuck() well during the chunk the process just dies...

0 Likes
1 Replies

Retrieving Models with Name in a Variable. ex $class::all() - is there a way to do it?

I have some code as follows: if($modconfig['needs_models']) { $models = explode(",",$...

0 Likes
1 Replies
Solved

how many relationships should a model have

HI , Ive got a question , Im rebuilding a application I built for a client about 6 years ago . At th...

0 Likes
10 Replies
Solved
posted 9 years ago

Where cause in multiple table in Eloquent ORM

I have 2 tables like devices and users users table -id -full_name -email -phone devices table -id -u...

0 Likes
0 Replies

Laravel 5.1 Eloquent multiple pivot tables or threeway pivot?

I am struggling. What I try to do is to create a message system where users can send messages to eac...

0 Likes
0 Replies

Passing variables from one seed file to another?

I have created multiple seed files and my main DatabaseSeeder file looks like this: <?php use Il...

0 Likes
0 Replies

Most Used Tags

hi! I have a Post and Tag model with a many to many pivot table, how do you write a query to find th...

0 Likes
0 Replies

Multiple Joins from Two Tables

Hi, everyone. I need to implement the following list. No | Subject | Provider | Replier 1 | Subject1...

0 Likes
1 Replies
Solved

Grouping rows separately depending on column value

I have two models: Event and EventLink. Event has a one-to-many relationship with EventLink, and Eve...

0 Likes
3 Replies

Use subdomain in routes in laravel 5.1

just wrote tutorial about using subdomain in route http://dunebook.com/use-subdomain-in-routes-in-...

0 Likes
0 Replies

Free Laravel 5 Tutorial Series with Online Shop Tutorial Project

Hi everyone. I would like to share the link to Free Laravel 5 Tutorial Series explained using a real...

0 Likes
0 Replies

Select unique option from same table

Hello, i have two select boxes in the same form. Both are beeing populated through JSON which works...

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.