Support the ongoing development of Laravel.io →

4,548 Threads

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

select user followed person's post

users id follows id user_id follow_id posts id user_id let say i am user A and i followed user B. I...

0 Likes 0 Replies

How to properly design interchangeable user repository implementation?

I want the repository to be interchangeable, so I'm not dependant on Eloquent. I therefore have an i...

0 Likes 0 Replies

Basic http authentication

I know how to use Laravel's basic authentication and how to change the column name. Is there a way t...

0 Likes 6 Replies
Solved

Any easier way to do this? Can you extend a model that's a conditional of the parent model?

Check out my code here: http://laravel.io/bin/9n9 I have a working solution now as shown, but I'd li...

0 Likes 0 Replies

select from $query

I have a fairly complex query that combines (via union) the results of a couple of different queries...

0 Likes 1 Replies
Solved

Advanced leftJoin with date functions

Hi, I have https://gist.github.com/RokSiEu/8793452 But I need to get https://gist.github.com/RokSiEu...

0 Likes 1 Replies

Derived table from Pivot table

Hi folks, i have an issue about a derived table from a pivot table. Here is my schema: locale id nam...

0 Likes 4 Replies

How can I add where clause on DB::raw equation result?

I have a query with a select that has a DB:raw equation to get an invoice balance. I'm not sure how...

0 Likes 0 Replies

Disable build-in commands

Is it possible to disable the build in commands like migrate. To be certain I can't run them by acci...

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

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.