g3n1us/laravel-react-sync 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

g3n1us/laravel-react-sync

Composer 安装命令:

composer require g3n1us/laravel-react-sync

包简介

Coordinate React frontends with a Laravel controller for updates and maintaining a universal frontend and backend application state

README 文档

README

Make your React components and Laravel models play nicely!

Installation

Install using Composer:

composer require g3n1us/laravel-react-sync

Note: The next step will be unnecessary in most cases

If using Laravel 5.5 or later and autodiscovery is not disabled, the package will be discovered and ready to use automatically. If NOT, then add the service provider to the list of providers in config/app.php.

'providers' => [
	/*
	 * Application Service Providers...
	 */
	 G3n1us\LaravelReactSync\LaravelReactSyncServiceProvider::class,
]

Run react-sync Preset

If this you are installing the library on a fresh Laravel installation, run the preset Artisan command to complete installation

Note: If this is NOT a fresh installation, do no run this command. Instead, you can run php artisan vendor:publish to copy the necessary files into your resources directory.

php artisan preset react-sync

Follow the onscreen instructions, and run:

npm install && npm run dev

Installation is complete!

Usage

ReactSync provides two base components to be used in the place of the standard React.Component. The first MasterComponent is hydrated with the Laravel view's data. This is set via an included Blade template in the top of your application's markup. The provides a global object that contains application data that maps to the data that is part of the context of the Blade view. Additionally, this object contains objects and methods that provide access to the underlying Laravel application's data, such as the Request, defined Guards, the Route and the authenticated user.

This data can be used in components extending this class. Changes set via a traditional web form (or form fields) will mutate your state and trigger a render as you would expect in React.

Alternately, the ReactSyncAppData.page_data object can be mutated manually to trigger a refresh, as this object is set as the components initial state.

GH Pages URL https://g3n1us.github.io/laravel-react-sync/

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: JavaScript

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2018-03-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固