DEV Community

Cover image for Are you tired of API response naming conflicts between Front-End & Back-End?
Rizk Ussef
Rizk Ussef

Posted on

Are you tired of API response naming conflicts between Front-End & Back-End?

πŸš€ Are you tired of API response naming conflicts between Front-End & Back-End?

Here’s the common problem:

βœ” Back-End returns snake_case.

βœ” Front-End wants camelCase.

❌ Result? Wasted time mapping keys manually.

πŸ‘¨β€πŸ’» I solved this with a Laravel Package that does all the work automatically!
πŸπŸ”πŸ« Laravel Snake-to-Camel Case Package
πŸ“¦ Features:
βœ… Two Middlewares:

1️⃣ Convert API Responses β†’ camelCase.

2️⃣ Convert Form Requests β†’ snake_case.

βœ… Super easy: Just install it (no manual provider registration).

βœ… Configurable: Apply to API, Web, or both.

βœ… Choose: Response only or Request + Response.

πŸ“Œ Example config:

'apply_to' => 'all',
'convert_request' => true,
'convert_response' => true,

🎯 Result:
βœ… No conflicts.

βœ… Faster integration.

βœ… Cleaner code.

πŸ‘‰

Check it out here:
https://packagist.org/packages/rizkussef/laravel-snake-to-camel-case

Top comments (0)