-
Notifications
You must be signed in to change notification settings - Fork 10.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Camel case model relationship is returned as snake case property #13614
Comments
No, sorry. |
@GrahamCampbell Isn't ref: https://github.com/laravel/framework/blob/5.2/src/Illuminate/Database/Eloquent/Model.php#L204 |
@klimentLambevski you can solve this using: Network.php public function pointsOfSale()
{
return $this->hasMany(PointOfSale::class);
} PointOfSale.php public function network()
{
return $this->belongsTo(Network::class, 'networkId');
} |
I wish this worked for the Factory and Seeder, it still converts it to "
|
How can i tell laravel to return the relationship results in same name as the relationship function?
ex. I have relationship called
mediaItem
and when i call $model->with('mediaItem') is is returned as{media_item: {}}
. Is there a way that it is returned as {mediaItem:{}}?The text was updated successfully, but these errors were encountered: