Category: PHP, api, javascript

In almost any Web-application there is some set of values that are used on both backend and frontend parts. Sometimes there are some user input validation values that are used at the same time in frontend and backend input validation.

The vast majority of modern Web-applications consist of frontend and backend parts.

Here constants are set in backend code and a special backend API method is created which the frontend part uses to get shared constants.

On the other hand, code generation on Web-request is easier to implement as it is enough to have reflection mechanism in the programming languages used by backend in order to get shared constants values defined in some part of backend code.
Newsletter

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

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners