laravel-shared-data maintained by coderello
Last update
2022/02/22 15:28
License
Require
- ext-json *
- php ^7.3|^8.0
- illuminate/support ^6.0|^7.0|^8.0
Last update
2021/10/22 14:44
License
Require
- php ^7.3|^8.0
- ext-json *
- illuminate/support ^6.0|^7.0|^8.0
Last update
2021/01/29 10:00
License
Require
- php ^7.3|^8.0
- ext-json *
- illuminate/support ^6.0|^7.0|^8.0
Last update
2020/11/18 12:39
License
Require
- php ^7.3|^8.0
- ext-json *
- illuminate/support ^6.0|^7.0|^8.0
Last update
2020/10/01 14:05
License
Require
- php ^7.3
- ext-json *
- illuminate/support ^6.0|^7.0|^8.0
Last update
2020/09/09 09:58
License
Require
- php ^7.3
- ext-json *
- illuminate/support ^6.0|^7.0|^8.0
Last update
2020/05/12 15:42
License
Require
- ext-json *
- php ^7.2
- illuminate/support 5.8.*|^6.0|^7.0
Last update
2020/05/12 15:42
License
Require
- php ^7.2
- ext-json *
- illuminate/support 5.8.*|^6.0|^7.0
Last update
2020/03/03 07:29
License
Require
- ext-json *
- illuminate/support 5.8.*|^6.0|^7.0
- php ^7.2
Last update
2020/03/03 07:29
License
Require
- php ^7.2
- ext-json *
- illuminate/support 5.8.*|^6.0|^7.0
Last update
2019/03/18 22:34
License
Require
- php >=7.1
- laravel/framework 5.5.*|5.6.*|5.7.*|5.8.*
- ext-json *
Last update
2019/03/18 22:02
License
Require
- php >=7.1
- laravel/framework 5.5.*|5.6.*|5.7.*|5.8.*
- ext-json *
Laravel Shared Data
✨ Introduction
Laravel Shared Data provides an easy way to share the data from your backend to the JavaScript.
🚀 Quick start
-
Install the package:
composer require coderello/laravel-shared-data -
Include the
@shareddirective into your blade layout before all scripts. -
Share the data from within Laravel:
share(['user' => $user, 'title' => $title]); -
Access the data from the JavaScript directly:
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');
📖 License
Laravel Shared Data is open-sourced software licensed under the MIT license.