2017 © Pedro Peláez
 

library static-generator

Generate static HTML/JSON files from Laravel routes

image

davekelly/static-generator

Generate static HTML/JSON files from Laravel routes

  • Friday, October 17, 2014
  • by davekelly
  • Repository
  • 3 Watchers
  • 11 Stars
  • 189 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 4 Versions
  • 1 % Grown

The README.md

Static Generator (Laravel 4.2)

Generate static HTML or JSON files from Laravel routes., (*1)

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., (*2)

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., (*3)

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., (*4)

  • 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, (*5)

The Versions

17/10 2014

dev-master

9999999-dev

Generate static HTML/JSON files from Laravel routes

  Sources   Download

MIT

The Requires

 

laravel html static front-end

23/09 2014

v0.2.0

0.2.0.0

Generate static HTML/JSON files from Laravel routes

  Sources   Download

MIT

The Requires

 

laravel html static front-end

18/09 2014

v0.1.2-beta

0.1.2.0-beta

Generate static HTML/JSON files from Laravel routes

  Sources   Download

MIT

The Requires

 

laravel html static front-end

20/08 2014

v0.1.1-beta

0.1.1.0-beta

Generate static HTML/JSON files from Laravel routes

  Sources   Download

MIT

The Requires

 

laravel html static front-end