A Laravel 12-based RESTful API for property management, supporting properties, tenants, leases, and payment tracking across multiple user roles.
This API enables complete CRUD operations with role-based access control, performance optimization through caching, and asynchronous task handling. Built with Laravel Sanctum for authentication and fully tested and documented.
- PHP 8.3+
- Composer 2.x
- Node.js 18+
- MySQL 8.0+ / PostgreSQL 13+ / SQLite 3.8.8+
- Redis (optional for caching/queues)
- Docker (optional for containerization)
# Clone the repository
git clone git@github.com:Geekigen/Laravel-Property-management--Api.git
cd Laravel-Property-management
# Install dependencies
composer install
npm install
# Environment setup
cp .env.example .env
php artisan key:generate
# Database configuration
#DB_CONNECTION=mysql
# DB_HOST=127.0.0.1
# DB_PORT=3306
# DB_DATABASE=laravel
# DB_USERNAME=root
# DB_PASSWORD=
# Run migrations with seed data
php artisan migrate
php artisan db:seed
For Docker users:
docker-compose up -d
Development:
php artisan serve
Production:
php artisan optimize
php artisan route:cache
php artisan view:cache
php artisan config:cache
Complete documentation available at: https://documenter.getpostman.com/view/27137771/2sB2j989gk
Import the Postman collection to test all endpoints including authentication, properties, units, tenants, leases, and payments.
- Repository Pattern: Database logic abstraction for better testing and organization
- RESTful Design: Following REST principles with filtering, pagination, and sorting
- Database Structure: Relational design with proper migrations and relationships
- Test-Driven: 80%+ test coverage with mocking for external dependencies
- Modular Design: Follows Laravel conventions for separation of concerns
The schema includes:
- Users (with role-based access)
- Properties
- Units
- Tenants
- Leases
- Payments
Implemented with proper relationships, eager loading optimization, and indexing.
- Caching: Configurable cache system with automatic invalidation
- Query Optimization: Eager loading and indexing for database performance
- Profiling: Laravel Telescope integration for endpoint optimization
- Token-based authentication with Laravel Sanctum
- Role-based access control
- Form request validation
- Rate limiting
- Environment-based configuration
- XSS/CSRF protection
- Stateless API design for horizontal scaling
- Database optimization with indexing and read replicas
- Redis caching to reduce database load
- Queue system for asynchronous tasks
- Containerization for deployment consistency
Comprehensive test suite including:
- Feature tests for authentication and controller actions
- Unit tests for repositories and services
- 80%+ code coverage
- Docker configuration
- Complete Postman documentation
- Seeded sample data
# Fix storage permissions
chmod -R 775 storage bootstrap/cache
# Resolve class autoloading issues
composer dump-autoload
# Clear application caches
php artisan optimize:clear
git pull
composer install
php artisan migrate
php artisan optimize