Source: medium.com

Laravel Request Hydration

Category: Laravel, PHP

One of the repeated stuff in the development is hydration the Data Transfer Objects. PHP ecosystem from old days works with array and in fact, array in PHP is one of the powerful tools. for small projects, personally prefer the array but nobody can ignore the DTO goodness. recently I made a tiny package to hydrate Data Transfer Object from the request, after installing two methods `castTo()` and `hydrateTo()` will be added to `Illuminate\Http\Request`. Laravel version: https://github.com/mvaliolahi/request-hydratorPure version: https://github.com/mvaliolahi/hyrator
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners