Support the ongoing development of Laravel.io →

988 Threads

Eloquent models with IoC

I'm using the IoC Container to allow me to run model validation automagically, by binding a User mod...

0 Likes
5 Replies
Solved

[solved]Best way to create friendship between users

I'm trying to figure out what would be the best way to create options for users to add friends, I ha...

0 Likes
2 Replies
Solved

Database Eloquent Modeling with dynamic table names ?

How can I model dynamic tables names. For example. A product has orders, all orders for the same pr...

0 Likes
1 Replies
Solved

Best Practices for Validation Inside Models

I just came across an example that put the validation inside of a model like so: class User extends...

0 Likes
4 Replies
Solved

Database Truncate Even If It Has Foreign Key

I have a database seeder begins with: DB::table('lessons')->truncate(); But when I run seeder, [I...

0 Likes
3 Replies
Solved

Eloquent model event executed on Query\Builder instead of Model

Hi everyone, i have pretty weird problem. I am developing a project with Laravel with my laptop (XAM...

0 Likes
1 Replies
Solved

foreach on eloquent from last to first

I have a post object that has comments: $post->comments now when I do a select on the comments Im...

0 Likes
2 Replies
Solved

query returning something wrong

Hi... I started using laravel 2-3 months ago and for the first time I have a problem I can't solve :...

0 Likes
1 Replies
Solved

Many to Many Relationship problem

So i have problem about many to many relationship implementation in laravel I have two model, User a...

0 Likes
1 Replies
Solved
posted 10 years ago

Accessing data from table using relationship

I've users,posts,comments table. Here are my models user model public function posts() { return $...

0 Likes
6 Replies
Solved
posted 10 years ago

Best way to handle user input filters for a list of records?

Ok, maybe I'm tired today but I cant figure out the best way to handle this: I have a paginated view...

0 Likes
2 Replies
Solved

Eloquent model default scope.

Hi all, I am looking to create two models, both on top of the same table. I know that I could do wit...

0 Likes
2 Replies
Solved

Add two months to the current date

Hi, I am trying to add two months to the current date : $sale->sale_date = date('Y-m-d 00:00:0...

0 Likes
8 Replies
Solved

Eloquent Relationships Bad Practices?

If I have two models: Institution and InstitutionStatus Is it considered bad practice to have Instit...

0 Likes
1 Replies
Solved
posted 10 years ago

Eloquent and database functions

Hi there. I'm new to Laravel so please be gentle with me! I'm a little stumped as to how I would go...

0 Likes
3 Replies
Solved

Adding Select statement to ORM

Retrieving A Record By Primary Key $user = User::find(1); var_dump($user->name); Is there anyway...

0 Likes
4 Replies
Solved
posted 10 years ago

Retrieve the sender username of a message with relationships

In my Message.php model, I defined the following: class Message extends Eloquent { public functi...

0 Likes
3 Replies
Solved

Related table, possible issue with table name?

Hi, I have a simple scenario here that is bugging me. There are two models: class DbNation extends E...

0 Likes
3 Replies
Solved

Accessing Model and Controller from custom library class

I'm trying to access a Model and Controller from a custom library class. I have created an app/lib f...

0 Likes
2 Replies
Solved

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

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.