定制 davekelly/static-generator 二次开发

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

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

davekelly/static-generator

Composer 安装命令:

composer require davekelly/static-generator

包简介

Generate static HTML/JSON files from Laravel routes

README 文档

README

Generate static HTML or JSON files from Laravel routes.

This was developed for use with small data visualisation-type applications where it is not required to deploy a full PHP app with a database. Instead, a front-end-only version with data held as JSON can be used. I have needed to use HTML-only versions of Laravel apps often enough that this package made sense.

Setup & Usage

Installation

  • Add 'Davekelly\StaticGenerator\StaticGeneratorServiceProvider', to the end of the providers array in /app/config/app.php
  • You will need to create a writable directory at /public/static - this is where the static files are placed

Usage

Usage is through a front-end interface. The package adds a route to /generate where you will find this interface.

If you generate a static version of a Route that returns a JSON response, the file will have a .json extension, otherwise, it will be .html.

  • Visit http://your.domain/generate to see a list of Routes registered in your application
  • Click the button next to the Route you'd like to generate a static file for
  • If successful, the .html or .json file will be stored in /public/static - you'll be shown a confirmation message with the location & file-name.

Uses

Future To-Do's / Improvements

  • Create an Artisan CLI interface
  • Look at filtered routes

Updates

v0.2 - Creates html nested directories mimicking route structure (e.g. route: /about/contact saved to /static/about/contact/index.html) - based on idea from pulkitjalan

统计信息

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

GitHub 信息

  • Stars: 14
  • Watchers: 3
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-08-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固