Support the ongoing development of Laravel.io →

4,311 Threads

posted 10 years ago

Help with Eloquent relationships

I have the following tables products variants attributes options option_variant Look at this sqlfidd...

0 Likes
1 Replies

Did I find a bug in Eloquent? ID is not being set correctly using a hasManyThrough relationship and paginate.

Hi there, I have the following three models and relationships set up. class Customer extends \Eloque...

0 Likes
2 Replies

Ecommerce With admin panel

hi can anybody help me to built shopping cart with admin panel or is there any reference link where...

0 Likes
3 Replies

How can I do this SQL query whit Eloquent?

Hello, Im new whit laravel, and I would to like do this query, in SQL it would be something like thi...

0 Likes
3 Replies
Solved

3 table relationship question

I am trying to figure out how to get a specific 3 table relationship working. I have a business list...

0 Likes
3 Replies

What is the easiest way to add the count of records that matched the whereIn to this model chain?

I have this eloquant model chain which works fine but I would like to add the count of matched recor...

0 Likes
0 Replies

Using $this when not in object context | Repository & Command Bus

I am using Laravel Commander to use the command bus to handle everything in an app I am building. I...

0 Likes
1 Replies
Solved

sorting multiple tables by time

hello to every one, I am trying to sort multiple tables like this; //Controller http://laravel.io/bi...

0 Likes
4 Replies
Solved

Eloquent Query's not working with a certain table

Hello, I am porting my current website over to laravel and I'm having some issues. I'm trying to lis...

0 Likes
5 Replies
Solved
posted 10 years ago

How to change object key when get data?

Assume i am going to fetch country list. $country = Country::get(); foreach($country as value){ ec...

0 Likes
0 Replies

Multiple tables over multiple databases in a single Model

I am in the planning stage of undertaking a database migration where the two databases (one MySQL, o...

0 Likes
4 Replies
Solved
posted 10 years ago

Creating new model object with unusual value

Hi, I want to create and save model, something like this: $page = new \Page; $page->fill(\Input::...

0 Likes
2 Replies
Solved

Deleting DB-entry: findOrFail or destroy?

Hi, is there a difference between $go = Project::findOrFail($id); $go->delete(); and Project::de...

0 Likes
2 Replies

Best way of retreiving items with a condition on the relation

#The goal# What I'm trying to do is generate a new collection with all the Consultations ordered by...

0 Likes
3 Replies
Solved

Handling in model validation

I read everywhere that in model validation is best practice, but I don't know how to handle a failed...

0 Likes
3 Replies
Solved

Get last 10 tags, polymorphic many-to-many

Hello guys, how can I get last 10 used posts tags? http://help.laravel.io/bd1f15c318d5358b745f27afe3...

0 Likes
1 Replies

Seeding only new files

Hello! Is it possible to know which seeds ar allready seeded and which are new automatically with ar...

0 Likes
2 Replies
Solved

Wrong colums deleted??

Hello, I have some data displayed in table...lets asume like this: 1 - Title1 - Edit, Delete 2 - Tit...

0 Likes
1 Replies

Return specific column

$this->model->find($id)->tags()->get()->toJson(); Not return columns the table tags I...

0 Likes
1 Replies

Where can I keep my collection filters?

Hi, I have controller filters like those: <?php $stats = Stats::all(); $stats_today = $stats-...

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