Support the ongoing development of Laravel.io →
Database Eloquent

Hi everyone

I've been searching this for a while, but couldn't find the specific subject

So here is the thing:

For the DB I want to use the snake case convention (aka underscore convention) but on the PHP I want the camelCase for the variables.

ex:

DB:

users
- first_name

PHP

$user->firstName

Is there a way to achieve this?

Last updated 3 years ago.
0

Awesome, that was exactly what I was looking

Thanks :)

0

Sign in to participate in this thread!

PHPverse

Your banner here too?

MLoureiro mloureiro Joined 3 Jun 2014

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.

© 2025 Laravel.io - All rights reserved.