ekoh / blog-posts
A simple blog package in php
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/ekoh/blog-posts
Requires
- php: ^7.0
Requires (Dev)
- fakerphp/faker: ^1.17
- pestphp/pest: ^1.21
This package is not auto-updated.
Last update: 2025-10-20 04:55:49 UTC
README
#Blog Posts Package
A simple blog posts package in PHP used for teaching package development in PHP on my free youtube course.
##installation
To install this package, use composer
composer require ekoh/blog-posts
##Usage
$blog = Blog::getInstance(); $postArray = [ 'id' => 1, 'Title' => 'Post title', 'image' => 'Path/to/image (optional)', 'body' => 'post body', 'author' => 'author', 'hidden' => 0, 'comments' => [] ]; $blog->addPost($postArray); $blog->getPosts($offset, $limit); $blog->editPost($postId, $postArray); $blog->getPost($postId); $post = new Post($postId); $commentArray = [ 'body' => 'post comment', 'author' => 'optional' ]; $post->addComment($commentArray); $post->getComments($offset, $limit); $post->editComment($commentId, $commentArray);