Projetos
Ver no GitHub
coderello/laravel-shared-data
Sobre
📦 An easy way to share the data from your backend to the JavaScript.
Outros projetosCrescimento medido de estrelas
- em 24 h
- 0
- em 7 dias
- 0
- em 15 dias
- -1
- em 1 mês
- Coletando histórico
Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.
README.md
OriginalLaravel 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-dataInclude 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.
Explore projetos relacionados
Carregando…