Support the ongoing development of Laravel.io →

4,300 Threads

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
posted 10 years ago

Model 'Request' is not loaded

Hey guys. I just began to work with laravel. Sorry for bad English. So I've got a table named 'reque...

0 Likes
3 Replies
Solved

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

[macro] Form::select() with optgroups based on model's field

Suppose you have a simple products table: id | name | category ....................... 1 | prod1 |...

0 Likes
1 Replies

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

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
posted 10 years ago

Laravel model metadata

Hello there is this old thread here: http://forumsarchive.laravel.io/viewtopic.php?pid=52059 Someone...

0 Likes
6 Replies
Solved

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
posted 10 years ago

Eager Load with Limit / Take()

Hi guys i'm trying to Load all Collection with Items inside Collection with Eager Load but i only wa...

0 Likes
1 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

Fix for "Undefined property: {ModelName}:$attributes" error

The old forums either had no solution for this, OR said the issue was solved by switching to file ca...

0 Likes
0 Replies

How to clean up this code? Dynamically setting property names, eager loading, handling arrays

WARNING: NASTY PROCEDURAL CODE AHEAD. Let's say I have an ajaxified to-do list app. I have this rout...

0 Likes
0 Replies

[Tutorial] Model Validation using Observers

Hi guys, I have recently posted a new tutorial on something that seems to have been missed by the La...

0 Likes
2 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
posted 10 years ago

Foreign Keys without schema builder

I've been building most of my database tables without the use of the schema builder. I need to creat...

0 Likes
4 Replies
Solved

Is it possible to call directly from a class.

Hi all, I'm still chipping away at learning Laravel. Coming along slowly though. :-/ In my db class...

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.

© 2024 Laravel.io - All rights reserved.