定制 coderello/laravel-shared-data 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

coderello/laravel-shared-data

最新稳定版本:4.0.0

Composer 安装命令:

composer require coderello/laravel-shared-data

包简介

Package for sharing data from Laravel to JavaScript.

README 文档

README

✨ 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.

统计信息

  • 总下载量: 76.74k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 316
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 316
  • Watchers: 4
  • Forks: 24
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-03-18