Laravel Model attributes in camelCase. Two ways to have it.

Luís Nóbrega
3 min readSep 2, 2020

In this article, I will talk about how to have camelCase properties in Eloquent models. Let’s see these two ways.

Photo by Isabella Jusková on Unsplash

One of the issues in using models with Eloquent ORM is having the default behavior of all the attributes in snake_case.

Like this for example:

// We import the model class.
use App\Model\Image;

--

--

Luís Nóbrega

Web Developer at 25friday. Likes to travel, write and being a father.