Package Data | |
---|---|
Maintainer Username: | davekelly |
Maintainer Contact: | hello@davidkelly.ie (Dave Kelly) |
Package Create Date: | 2014-08-20 |
Package Last Update: | 2019-07-23 |
Home Page: | http://www.davidkelly.ie/2014/08/28/laravel-static-page-generator/ |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-12 15:01:43 |
Package Statistics | |
---|---|
Total Downloads: | 209 |
Monthly Downloads: | 2 |
Daily Downloads: | 0 |
Total Stars: | 14 |
Total Watchers: | 3 |
Total Forks: | 4 |
Total Open Issues: | 1 |
#Static Generator
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
'Davekelly\StaticGenerator\StaticGeneratorServiceProvider',
to the end of the providers
array in /app/config/app.php
/public/static
- this is where the static files are placedUsage 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
.
http://your.domain/generate
to see a list of Routes registered in your application.html
or .json
file will be stored in /public/static
- you'll be shown a confirmation message with the location & file-name.##Future To-Do's / Improvements
##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