morsapt / changelog
Simple Changelog CRUD API to store markdown and parse it to HTML output
Requires
- php: ^7.2 || ^8.0
- league/commonmark: ^1.6|| ^2.0
This package is auto-updated.
Last update: 2024-04-24 14:58:35 UTC
README
A simple CRUD to maintain changelog markdown entries on database, and output it as HTML code.
Disclaimer
This was the first package I made for Laravel so there might be some things missing or not complete. For that forgive me. Feel free to contribute, if you like. I made this because I needed to maintain the users informed about new version details. It was only intended for internal usage.
Install
- Install the package using composer.
composer require morsapt/changelog
- Run the migration
php artisan migrate
this will create the changelog table with a mpt_
prefix - mpt_changelogs
Endpoints
GET /changelogs
- return all changelog entriesGET /changelogs/{changelog_id}
- return specific changelog entry based on its PK (id)POST /changelogs
- craete a changelog entryPUT /changelogs/{changelog_id}
- update a changelog entryDELETE /changelogs/{changelog_id}
- delete a changelog entry
Sorting and Limiting
By default, GET /changelogs
endpoint uses paginate and will paginate accordingly
with perPage
and orderBy
parameters.
perPage
- with set the number of items per page that paginate with return:- max number of items is set 500
- it will only accept integer values; in case of an invalid value it will be set to 10 itens only.
orderBy
- array of parameters- order of parameters will change the sorting order for the query
- values allowed:
ASC
andDESC
page
- page number (from Laravel pagination)
Example of GET
https://my.tld/api/changelogs?perPage=50orderBy[changelog]=ASC&orderBy[id]=DESC
This will get you 50 itens per page, sorting by changelog
column ASCending and id
column DESCending.