coderello/
laravel-shared-data
g4t.io

Laravel Shared Data Package

312 stars by Paul Redmond

Package for sharing data from Laravel to JavaScript.

README from coderello/laravel-shared-data Open on GitHub →

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 @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 the MIT license.

More from the ecosystem

marcreichel/
laya-php
g4t.io
3 53

LayaPHP: Self-Hosted Text Classification for PHP and Laravel

Classify text in PHP without an LLM bill: typed decisions in 100+ languages, self-hosted. Laravel-ready SDK for Laya, a Jev AI alternative.

ai classification decision-engine
marcreichel/laya-php via Laravel News
Josh-Dovey/
postcodes-laravel
g4t.io
5 9

Postcodes for Laravel: GB Postcode Lookup and Geography Data

Postcodes for Laravel adds typed GB postcode lookups, validation, geography data, distance searches, and test fakes through the GB Postcodes API.

Josh-Dovey/postcodes-laravel via Laravel News
RedberryProducts/
mailbox-for-laravel
g4t.io
4 115

Mailbox for Laravel: Preview and Test Rendered Email

Mailbox for Laravel captures outgoing mail in a local dashboard and lets you test rendered HTML, recipients, and attachments with fluent assertions.

RedberryProducts/mailbox-for-laravel via Laravel News