Support the ongoing development of Laravel.io →

4,312 Threads

Polymorphic relationships and factory method

Hello, ##Tables structure ###Users id - AI password - string email - string userable_id - integer us...

0 Likes
6 Replies

Calling setHidden from outside model does not limit attributes?

I'm trying to limit the number of attributes that all() returns, but failing to do so by using setHi...

0 Likes
3 Replies
Solved

Eloquent delete from table when the last connection is detached from pivot

Hi! I have images and products table and the pivot table is image_product. What is the best way to a...

0 Likes
0 Replies

join without select() does not load child objects

If you're using a join in your query along with a "with" function to hydrate a child field...

0 Likes
0 Replies

Editing in laravel

Hi I'm busy with a tutorial and when I try to use the edit line in the model, I end up having a blan...

0 Likes
4 Replies
Solved
posted 10 years ago

Retrieve Relationship Properties

I want to assign a post to an author, then when I display the post, I want to display it's author wi...

0 Likes
5 Replies
posted 10 years ago

Why doesn't a One to Many relationship's data get updated after adding an item?

If I use $post->comments()->save($comment) to add a new comment to a post, why does $post->...

0 Likes
1 Replies

A basic question on MVC

Is calling a model or executing a database query from the view, a bad practice or should the variabl...

0 Likes
6 Replies

What's the the best way to scope todo lists and todo items to a user? (unsure of correct terminology!)

I'm not sure if there's a specific term for what I'm trying to do -I think it's referred to as "...

0 Likes
4 Replies

Call to undefined method User::abc()

i don't call function in class User default on models #function protected function abc(){ return Use...

0 Likes
2 Replies

Remove duplicate query -- Pass data from filter to controller

I'm trying to get rid of a duplicate query. I use a filter to determine if the current url is correc...

0 Likes
2 Replies
Solved
posted 10 years ago

Strange registration error

Hi, I wanna make simple registration on my site, but I have an strange error. That's my form http://...

0 Likes
2 Replies
Solved
posted 10 years ago

Convert returned collection to the actual model

Hello everybody! I have a slight issue with Eloquent. Up until now I had a function that was retriev...

0 Likes
2 Replies
Solved
posted 10 years ago

Selectbox with all User of a special Role

Hi, I would like to show a Selectbox with a list of all Users, which have a Role of ID 1. How can I...

0 Likes
1 Replies
Solved

Mocking Model through facades

For all the other good stuff in laravel their is a Event::shouldReceive(), but for models, nothing....

0 Likes
0 Replies

Best Practice: Separating custom model functionality from Eloquent

Eloquent is great, but in big projects it's common for extended functionality to dig into models. I'...

0 Likes
5 Replies

Restful CRUD Operation with JSON input,output. Store json formatted data into database in laravel

Please suggest me some reference to implement Restful crud operation for schemas and also with json...

0 Likes
4 Replies
Solved
posted 10 years ago

Eloquent , using with() , and empty result

Hello, I try to find how to have only result where the relation return something, not when there emp...

0 Likes
2 Replies

Correct use of Repository pattern

Today I have a User model with a method updateWith($attrbs). It's just an example. If my object is a...

0 Likes
11 Replies

Schema builder and TIMESTAMP

How do you set defaults for timestamp column? $table->timestamp('row_modified')->default(DB::r...

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.