Support the ongoing development of Laravel.io →

4,606 Threads

Subquery error - SQLSTATE[42000]

I'm using the Laravel query builder to write a join statement and I find that I'm encountering a str...

0 Likes
0 Replies
posted 9 years ago

Where Between in Query Builder

I'm using query builder in Laravel 5.2 to make some similar to "SELECT value FROM table1 WHERE...

0 Likes
2 Replies

Unknown column 'photo' in 'field list' error in database

when i create a "photo" in the "flyer_photos" table with Tinker like below. >...

0 Likes
1 Replies

How to convert this SQL command into laravel 5.2 ?

if($type == 'fetch') { $events = array(); $query = mysqli_query($con, "SELECT * FROM calendar&q...

0 Likes
1 Replies

whereBetween

whereBetween() takes a field and an array. Is there a way to do a between on 2 fields with an input?...

0 Likes
3 Replies

Retrieving database data from the Controller

how can i retrieve data from the database using a controller

0 Likes
1 Replies

Undefined property: Illuminate\Database\Eloquent\Relations\HasMany::$due_date

I'm trying to create a collection of items that are over due. Here's my code Transaction.php /**...

0 Likes
1 Replies
Solved

Eager load a polymorphic relation with a constraint

Hello all! I am not a professional programmer but I am trying to develop an application for my perso...

0 Likes
0 Replies

Best Practice, many tables and many models?

Hi, So my app will have around 30 - 40 tables and therefore similar amount of models. It seems weird...

0 Likes
0 Replies

Artisan Tinker exception

Hi all... Sorry if is a noob question, i'm new to Laravel. When i do a simple command like this one:...

0 Likes
1 Replies
Solved

Laravel database failover?

Hey does anyone know if there is a relatively simple way to manage the database connection for failo...

0 Likes
0 Replies

Override Password encryption method for User model

Hi All I am using Laravel on top on an existing database. Another application is still also using th...

0 Likes
3 Replies

Query Builder - "orderBy()" when fetching data with "with()"

Hi all! I've got an Order model that hasOne('customer') bind to itself. I want to query something li...

0 Likes
5 Replies

Is there a way to sort whole collection based on related model.

Hi, all. I have a query builder question. I want the result to be sorted by a field in a related mod...

0 Likes
0 Replies

MySQL partitions and Schema Builder

Hi, I will start working in a new project that requires a massive database (tens of million rows) in...

0 Likes
0 Replies

Table reverting to old name, hidden variables?

I started playing around / learning laravel. Got everything set up and made a few models: artists s...

0 Likes
2 Replies

eager load with sum() on relations

Hi Artisans, I am trying to figure out how to reduce number of queries when I am doing this kind of...

0 Likes
1 Replies

Eager loading, collection of relations

Hi guys, How to get results of secondary query? Ofc I could merge all related collections: $paramet...

0 Likes
0 Replies

DB::raw as a parameter in another select statement.

Is it possible to make the customized column in database inside a new select clause using DB::raw()?...

0 Likes
0 Replies

Turn off eloquent events?

Is it possible to turn off eloquent events? Just temporarily, to stop myself getting into an event l...

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