Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

📦 An easy way to share the data from your backend to the JavaScript.

License

NotificationsYou must be signed in to change notification settings

coderello/laravel-shared-data

Repository files navigation

✨ 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@shared directive 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 theMIT license.

About

📦 An easy way to share the data from your backend to the JavaScript.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors4

  •  
  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp