A multi-user blog platform built with Laravel, where registered users can create, edit, and manage their own blog posts, while anyone can read published posts without an account.
Built as a structured learning project following a real software development lifecycle: requirements gathering, planning, design, development, testing, and documentation — with professional Git/GitHub practices throughout.
- User registration and authentication (Laravel Breeze)
- Public blog reading — no account required
- Authenticated users can create, edit, and delete their own posts
- Post fields: title, slug (auto-generated), excerpt, content, featured image, draft/published status
- Author-only authorization on edit/delete (enforced server-side, not just hidden in the UI)
- REST API with token-based authentication (Laravel Sanctum), fully testable in Postman
- Automated test suite (Pest) covering authentication, authorization, and CRUD behavior
- Backend: Laravel 13, PHP 8.3
- Database: MySQL
- Auth: Laravel Breeze (web), Laravel Sanctum (API)
- Testing: Pest
- API Testing: Postman
- Local environment: Laragon
-
Clone the repository *bash git clone https://github.com/onadith-thecoder/blog-webapp-test.git cd blog-webapp-test *
-
Install dependencies *bash composer install npm install *
-
Set up environment *bash cp .env.example .env php artisan key:generate * Then update
.envwith your MySQL database credentials. -
Run migrations *bash php artisan migrate *
-
Link storage (for image uploads) *bash php artisan storage:link *
-
Build frontend assets *bash npm run build *
-
Start the server *bash php artisan serve * Visit
http://127.0.0.1:8000
php artisan test| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /api/login |
Log in and receive an API token | No |
| POST | /api/logout |
Revoke current token | Yes |
| GET | /api/posts |
List published posts | No |
| GET | /api/posts/{id} |
View a single post | No |
| POST | /api/posts |
Create a post | Yes |
| PUT | /api/posts/{id} |
Update own post | Yes |
| DELETE | /api/posts/{id} |
Delete own post | Yes |
Authenticated requests require an Authorization: Bearer {token} header.
- Comments and likes on posts
- Post categories/tags
- User bio and avatar
- Frontend styling (currently unstyled by design, to focus on backend functionality)
- Deployment to a live hosting environment
Venuka (@onadith-thecoder)