The PHP2JS package for Laravel is an opinionated way to standardize the process of sharing data between PHP and JavaScript. There are many approaches to sharing data between the frontend and backend, so this package might not be for everyone, but it could offer you a simple solution for sharing data with JavaScript in a consistent way.
Read more on: https://laravel-news.com/php2js