🚀 Quick start
Install the package:
composer require coderello/laravel-shared-data
@shareddirective into your blade layout before all scripts.
Share the data from within Laravel:
share(['user' => $user, 'title' => $title]);
const user = window.sharedData.user; const title = window.sharedData.title;
Or using the built-it global helper:
const user = shared('user'); const title = shared('title');
Laravel Shared Data is open-sourced software licensed under the MIT license.