Using attributes to change table column names in laravel

Sometimes we may be working with a database that was created using less-than-logical column names. In those cases, we can use Laravel’s Eloquent ORM to allows us to interact with the table using more standardized names, without having to make database changes.

Getting ready

For this recipe, we need a standard Laravel installation, a properly configured MySQL database, and our migrations table set up by running the command php artisan migrate.

 

Recommended :  Using aggregates functions in laravel

About the author

Deven Rathore

I'm Deven Rathore, a multidisciplinary & self-taught designer with 3 years of experience. I'm passionate about technology, music, coffee, traveling and everything visually stimulating. Constantly learning and experiencing new things.

Pin It on Pinterest

Shares