Support the ongoing development of Laravel.io →

4,597 Threads

whereHas() within a where() sub-query.

Howdy! When I try to use a whereHas within a grouped where class, I get an error. Any ideas? $activi...

0 Likes
2 Replies

Setting transient properties on Eloquent models without saving to database?

Is there a way to set a transient property for an Eloquent model that won't save to the database? Fo...

0 Likes
3 Replies
Solved

Trying to query a relation of a relation

##Problem I have an eloquent model "Invoice" that hasMany "InvoiceTicket" that b...

0 Likes
5 Replies

Different types of users

Hello everyone, I'm an absolute beginner to Laravel, and this is my first thread, so I hope I'm not...

0 Likes
3 Replies

Auth, query scopes and whereHas() do not work together

i have set up users and roles table with a pivot table and i need to check, if logged user has admin...

0 Likes
0 Replies

Simple bog db structure and advice

I and looking to do my own blog to go alongside my new site build but was wonder what people would s...

0 Likes
4 Replies

Yup I give up.

I gotta give up. I don't want to, but I got to, because trying to learn Laravel with very very limit...

0 Likes
19 Replies

A question on the creation of Models regarding Many-To-Many relationships

Let's say, I have the following strong entities (and their attributes): Post (title, content) Tag...

0 Likes
5 Replies
Solved

Using Variable in DB function

DB::table('users') ->join('contacts', function($join) { $join->o...

0 Likes
2 Replies
Solved

About MVC in Laravel

Hello there, i'm new in laravel, also in MVC development and i want to ask for suggestion about the...

0 Likes
3 Replies
Solved

Create new relationship between two models

Hi, I have two models : Sale.php <?php class Sale extends Eloquent { public function groups() {...

0 Likes
4 Replies

TestCase is not running correctly

Hi, I came across very weird issue for test cases. I have written test cases in laravel application....

0 Likes
0 Replies

Problem with database query (Surprisng Results)

HI all, I am New to laravel and learning going through laravel documentation and practicing side by...

0 Likes
3 Replies

whereHas for polymorphic relations

Hello, I'm trying to load an Eloquent model with a polymorphic relationship. I want to get Photos th...

0 Likes
0 Replies

How to limit records from related tables?

Hi everyone! I'm new to laravel and I need some help with this problem. I have 2 tables posts and po...

0 Likes
4 Replies

"Prefix" all queries with a where clause

I'm buidling a SaaS and have added a client_id column to each of my tables. Now in my repositories,...

0 Likes
3 Replies

Eloquent: join on confition

Hi, I need to join one table into a query only if another condition is true. I try, using the exanpl...

0 Likes
4 Replies

Ho boy - I have a very large query with > 10 joins - is there a way I can do it with Eloquent?

I've been searching and hacking away for the past few hours now. I have a bunch of models. They're...

0 Likes
0 Replies

Eloquent nested eager loading : bug or fail syntax ?

Hi all :), First of all : I opened a help paste here describing the core of the problem. I did many...

0 Likes
0 Replies

Best practices or better way to achieve these relationships

I'm developing an application system. Breakdown is there are Events and Districts - the Application...

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.

© 2024 Laravel.io - All rights reserved.