A secure, scalable, and versioned REST API for managing a Library Book Borrowing System built with Laravel 12 + Sanctum Authentication.
This project follows industry-level backend architecture practices including API versioning, service classes, traits, resource transformation, rate limiting, and proper exception handling.
- Laravel Sanctum Authentication
- Login / Registration / Logout
- Profile management
- Rate limiting (Throttle protection for auth routes)
- API Versioning (/api/v1)
- Custom API Response Trait
- API Resources for clean JSON output
- Centralized Exception Handling (app.php)
- FormRequest validation with custom messages
- Model Binding (Route Model Binding)
- Blameable Trait (created_by tracking)
- CRUD operations
- Search & filtering
- Tracks created_by automatically
- CRUD operations
- Search & filtering
- Cover image upload using ImageService
- Tracks created_by
- CRUD operations
- Search & filtering
- Tracks created_by
- Borrow book system (CRUD)
- Return book system (stock increment)
- Overdue tracking
- Returned book status update
- Search & filtering
- Total Authors count
- Total Books count
- Total Members count
- Borrowed books count
- Overdue books count
✅ API Versioning system
✅ Clean JSON responses via Traits
✅ Central exception handling
✅ Secure file upload service (ImageService)
✅ Role-ready architecture design
✅ Borrow/Return stock logic
✅ Overdue tracking system
✅ Seeder & Factory for fake data
✅ Rate limiting for auth protection
- PHP 8+
- Laravel 12
- Laravel Sanctum
- MySQL
- REST API Architecture
- Postman (Testing)
-
Clone Repository git clone https://github.com/moinulwebdev/library-api.git
-
Place project in htdocs (XAMPP) or server root
-
Open project on code editor (vs code)
-
Start Apache & MySQL (XAMPP)
- composer install
- php artisan install:api
- php artisan migrate
- php artisan db:seed
- php artisan serve (On code editor project directory Terminal)
Email : admin@gmail.com
Password : admin
👨💻 Author
Md Moinul Islam
GitHub : https://github.com/moinulwebdev

